Wiki

Articles in category "tips"X
Displaying 41-50 of 141 result(s).

More on SSE and Yii

Created about a year ago by FirebreakerTips3 comments – viewed 3,825 times – ( +2 )
This is not actually Yii involved.

Inline views, write less

Created about a year ago by FirebreakerTips0 comments – viewed 4,151 times – ( +3 )
Sometimes writing views like

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

Created about a year ago by Luis Lobo BorobiaTips0 comments – viewed 4,039 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 about a year ago by thyseusTips4 comments – viewed 9,689 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 about a year ago by BoazTips0 comments – viewed 11,325 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 about a year ago by transistorTips1 comment – viewed 19,326 times – ( +2 / -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 about a year ago by le_topTips0 comments – viewed 6,852 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.

CjuiDatepicker

Created about a year ago by hiral darjiTips1 comment – viewed 5,788 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:

using jqbargraph to create beautiful graphs

Created about a year ago by MAHESH.E.UTips1 comment – viewed 5,940 times – ( +5 ) – version 1.1
If you are about to create a graph, the best option i would suggest is the jqbargraph.

Adding a date range search for CGridView the easy way

Created about a year ago by mikewalenTips4 comments – viewed 18,373 times – ( +12 ) – version 1.1
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.