Articles in category "tips"X
Displaying 51-60 of 153 result(s).

Customizing the CMenu Widget

Created 3 years ago by mistrybTips1 comment – viewed 46,983 times – ( +5 / -1 ) – version 1.1
The CMenu class provides some useful features for generating menus in your web application.

Search a file size range in CGridView

Created 3 years ago by CrazyCatTips0 comments – viewed 6,008 times – ( +2 )
Working on a report system of files transfert, I had to let the users simply find files by size. I didn't want to have two fields, I prefer a simple text input, with "human syntax".

More on SSE and Yii

Created 3 years ago by FirebreakerTips3 comments – viewed 5,269 times – ( +2 )
This is not actually Yii involved.

Inline views, write less

Created 3 years ago by FirebreakerTips0 comments – viewed 5,874 times – ( +3 )
Sometimes writing views like

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

Created 3 years ago by Luis Lobo BorobiaTips0 comments – viewed 5,964 times – ( +2 )
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.

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

Created 3 years ago by thyseusTips4 comments – viewed 12,330 times – ( +11 )
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:

Debugging CActiveRecord failed save() attempts

Created 3 years ago by BoazTips0 comments – viewed 20,321 times – ( +5 ) – version 1.1
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.

How to use a component before every action of a controller

Created 3 years ago by transistorTips1 comment – viewed 31,518 times – ( +3 / -1 ) – version 1.1
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.

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

Created 3 years ago by le_topTips0 comments – viewed 8,967 times – ( +5 ) – version 1.1
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.


Created 3 years ago by hiral darjiTips1 comment – viewed 7,415 times – ( +3 ) – version 1.1
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: