Wiki articles in category Tips

Showing 61-80 of 162 items.

Customizing the CMenu Widget

Created 12 years ago by mistryb mistryb, updated 10 years ago by mistryb mistryb.

The CMenu class provides some useful features for generating menus in your web application.

1 0
4 followers
Viewed: 69 865 times
Version: 1.1
Category: Tips

Search a file size range in CGridView

Created 12 years ago by CrazyCat CrazyCat, updated 12 years ago by CrazyCat CrazyCat.
  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
2 0
2 followers
Viewed: 12 649 times
Version: Unknown (update)
Category: Tips

More on SSE and Yii

Created 12 years ago by Firebreaker Firebreaker, updated 12 years ago by Firebreaker Firebreaker.

This is not actually Yii involved.

1 0
1 follower
Viewed: 10 533 times
Version: Unknown (update)
Category: Tips

Inline views, write less

Created 12 years ago by Firebreaker Firebreaker, updated 12 years ago by Firebreaker Firebreaker.

Sometimes writing views like

3 0
3 followers
Viewed: 12 417 times
Version: Unknown (update)
Category: Tips

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

Created 12 years ago by Luis Lobo Borobia Luis Lobo Borobia, updated 8 years ago by Luis Lobo Borobia 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: 15 928 times
Version: all
Category: Tips

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

Created 12 years ago by thyseus thyseus, updated 12 years ago by thyseus 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: 18 626 times
Version: Unknown (update)
Category: Tips

Debugging CActiveRecord failed save() attempts

Created 12 years ago by Boaz Boaz, updated 11 years ago by Boaz 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: 41 066 times
Version: 1.1
Category: Tips

How to use a component before every action of a controller

Created 12 years ago by transistor transistor, updated 12 years ago by transistor 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: 51 995 times
Version: 1.1
Category: Tips

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

Created 12 years ago by le_top le_top, updated 12 years ago by le_top 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: 16 085 times
Version: 1.1
Category: Tips

CjuiDatepicker

Created 12 years ago by hiral darji hiral darji, updated 12 years ago by hiral darji 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: 12 334 times
Version: 1.1
Category: Tips

using jqbargraph to create beautiful graphs

Created 12 years ago by MAHESH.E.U MAHESH.E.U, updated 12 years ago by MAHESH.E.U 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: 12 212 times
Version: 1.1
Category: Tips

Adding a date range search for CGridView the easy way

Created 12 years ago by mikewalen mikewalen, updated 11 years ago by mikewalen 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: 43 779 times
Version: 1.1
Category: Tips

Adding a link to a CDataColumn

Created 12 years ago by le_top le_top, updated 12 years ago by le_top 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: 28 024 times
Version: 1.1
Category: Tips

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

Created 12 years ago by le_top le_top, updated 12 years ago by le_top 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: 14 148 times
Version: 1.1
Category: Tips

Fixing extensions without modifying their code

Created 12 years ago by schmunk schmunk, updated 12 years ago by schmunk 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: 18 840 times
Version: 1.1
Category: Tips

PHPStorm & NetBeans autocomplete problem

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

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

12 0
14 followers
Viewed: 23 070 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 12 years ago by Rajith R Rajith R, updated 12 years ago by Rajith R 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: 61 848 times
Version: 1.1
Category: Tips

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

Created 12 years ago by seb seb, updated 12 years ago by François Gannaz François Gannaz.

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

1 1
3 followers
Viewed: 24 174 times
Version: 1.1
Category: Tips

An Easy Solution for Dependent dropDownList Using AJAX

Created 12 years ago by mrs mrs, updated 11 years ago by Kostas Apazidis (KonApaz) 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: 104 367 times
Version: 1.1
Category: Tips

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

Created 12 years ago by Xgamer99 Xgamer99, updated 12 years ago by Maurizio Domba Cerin 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: 22 516 times
Version: 1.1
Category: Tips