Wiki articles in category Tips

Showing 61-80 of 158 items.

Using Nginx and Apache2 in separate distributed servers (ie, Amazon EC2 instances)

Created 6 years ago by Luis Lobo Borobia, updated 2 years ago by Luis Lobo Borobia.

We are running one frontend running NGINX and several app servers running Apache2. There are several issues we have come across but right now I'll be documenting one of them. I'll be completing this article when I get more time.

2 0
2 followers
Viewed: 9 087 times
Version: all
Category: Tips

Using CListView to display items next to each other (in columns)

Created 6 years ago by thyseus, updated 6 years ago by thyseus.

When using CListView to display multiple views next to each other, we can use the $index variable inside the viewFile to achieve this. As far as i know there is no extension or out-of-the-box functionality for this, so we need to apply a little hack:

4 0
6 followers
Viewed: 15 282 times
Version: Unknown (update)
Category: Tips

Debugging CActiveRecord failed save() attempts

Created 6 years ago by Boaz, updated 5 years ago by Boaz.

When you're filling up a form of a CActiveRecord (using CActiveForm for example), usually you'll construct your code so that in case of validation error you'll get back the form with the error displayed back to you, typically when CActiveForm.errorSummary() is used. This is how its done by Gii.

4 0
2 followers
Viewed: 30 426 times
Version: 1.1
Category: Tips

How to use a component before every action of a controller

Created 6 years ago by transistor, updated 6 years ago by transistor.

I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.

2 0
4 followers
Viewed: 43 732 times
Version: 1.1
Category: Tips

CGridView: Adding behaviors from configuration, and template items from behaviors to CGridView

Created 6 years ago by le_top, updated 6 years ago by le_top.

Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it. I am surprised that this is not in the default implementation, so I made my default CGridView implementation.

3 0
3 followers
Viewed: 12 134 times
Version: 1.1
Category: Tips

CjuiDatepicker

Created 6 years ago by hiral darji, updated 6 years ago by hiral darji.

If you have two datepicker in one form and you want that a date of from date shold be minimum date of todate then put following code in Cjuidatepicker widget options array:

'onSelect'=>'js:function(selected) {
$("#HostelRoomStatusMaster_room_status_master_end_date").datepicker("option","minDate",selected);
				}',
1 0
5 followers
Viewed: 9 463 times
Version: 1.1
Category: Tips

using jqbargraph to create beautiful graphs

Created 6 years ago by MAHESH.E.U, updated 6 years ago by MAHESH.E.U.

If you are about to create a graph, the best option i would suggest is the jqbargraph.

5 0
9 followers
Viewed: 9 990 times
Version: 1.1
Category: Tips

Adding a date range search for CGridView the easy way

Created 6 years ago by mikewalen, updated 6 years ago by mikewalen.
  1. Create an Active Record Behavior that builds the criteria for the search() method and attach it to your model
  2. Modify the search() method of the model to merge the behavior's criteria in with the rest of the searchable attributes
  3. Modify the _search form view to add the date range inputs
6 0
11 followers
Viewed: 36 962 times
Version: 1.1
Category: Tips

Adding a link to a CDataColumn

Created 6 years ago by le_top, updated 6 years ago by le_top.

Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post. For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.

2 0
8 followers
Viewed: 21 283 times
Version: 1.1
Category: Tips

Patching PHP code (used as a library) without changing the original code!

Created 6 years ago by le_top, updated 6 years ago by le_top.

The article Fixing extensions without modifying their code reminded me of another patching technique that I used. My conviction and a hard look on the web had led me to an article [Redefine PHP class methods or class](http://stackoverflow.com/questions/137006/ph...

4 0
5 followers
Viewed: 8 843 times
Version: 1.1
Category: Tips

Fixing extensions without modifying their code

Created 6 years ago by schmunk, updated 6 years ago by schmunk.

If you're working a lot with extensions you often stumble upon problems, when you want to include them into your custom web application, like hardcoded or absolute path aliases or classes extended from core application components, which implement addiditonal features.

6 0
10 followers
Viewed: 12 878 times
Version: 1.1
Category: Tips

PHPStorm & NetBeans autocomplete problem

Created 6 years ago by Stageline, updated 6 years ago by Stageline.

The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.

12 0
14 followers
Viewed: 17 869 times
Version: 1.1
Category: Tips

Assigning dynamic roles to a user Using yii Rights module at the time of user creation and using some special advanced features of yii rights

Created 6 years ago by Rajith R, updated 6 years ago by Rajith R.

After Installing Yii Users and Rights to Newly Created Yii app we have to assign dynamic roles to a user at the time of user creation .

7 0
13 followers
Viewed: 51 258 times
Version: 1.1
Category: Tips

Speedup unit tests by moving MySql data to memory (in Ubuntu)

Created 6 years ago by seb, updated 6 years ago by Fran├žois Gannaz.

There are several ways to speedup slow unit tests which interact with database:

1 1
3 followers
Viewed: 17 998 times
Version: 1.1
Category: Tips

An Easy Solution for Dependent dropDownList Using AJAX

Created 6 years ago by mrs, updated 5 years ago by Kostas Apazidis (KonApaz).

Sometimes new Yii guys face problem to manage dependent dropDownList using AJAX. I am going to discuss an easy solution about this issue.

7 1
24 followers
Viewed: 93 552 times
Version: 1.1
Category: Tips

Adding 'disabled' to CCheckBoxColumn and support for yiigridview.js

Created 7 years ago by Xgamer99, updated 7 years ago by Maurizio Domba Cerin.

I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it o...

1 0
7 followers
Viewed: 17 610 times
Version: 1.1
Category: Tips

Setting static modules' properties in config

Created 7 years ago by Alexander Palamarchuk, updated 7 years ago by Alexander Palamarchuk.

You may face a situation when you need to access to a configurable module's property from everywhere and you don't have an instance of this module's class.

1 1
2 followers
Viewed: 11 494 times
Version: 1.1
Category: Tips
Tags: config, module

Making friends' configs, DB credentials and paths with version control

Created 7 years ago by Alexander Palamarchuk, updated 6 years ago by ajsharma.

In many cases developers of one project use their own local environments for coding. There may be a common test platform and, of course, production. All these environments usually have different DB credentials and directory structures (first of all, path to YII framework directory). Another feature is debugging. It's convenient to turn it on for local environments, eventually - on the test s...

1 1
4 followers
Viewed: 11 441 times
Version: 1.1
Category: Tips
Tags: config

[pt-br] O guia de estudos do Yii para iniciantes

Created 7 years ago by Rodrigo Coelho, updated 7 years ago by Rodrigo Coelho.

You can find the english version of this wiki here: The complete beginner's study guide for the Yii Framework.

1 0
3 followers
Viewed: 11 265 times
Version: 1.1
Category: Tips
Tags:

The complete beginner's study guide for the Yii Framework

Created 7 years ago by Rodrigo Coelho, updated 7 years ago by Rodrigo Coelho.

Start studying the MVC pattern. You will understand the roles of the model, the view and the controller and know where goes each part of the code.

12 0
19 followers
Viewed: 103 409 times
Version: 1.1
Category: Tips