Wiki

Articles in category "tips", sorted by commentsX
Displaying 31-40 of 134 result(s).

using multiple radio button

Created 2 years ago by francis jaTips4 comments – viewed 27,998 times – ( +6 / -1 ) – version 1.1
When we use multiple radio buttons with same name in Yii many people have the problem on getting the value of the selected radiobutton. The radioButtonList can be used for that, but if we need to use radioButton itself to place the button any where in a view, we need to include one more parameter in htmloption array().

Rendering Views and Updating them with Ajax

Created 10 months ago by Manish GuptaTips4 comments – viewed 12,085 times – ( +2 )
I wanted to implement a widget that could refresh itself through Ajax without refreshing the whole page. CGridView and CListView are excellent examples of such widgets.

Customize CGridView columns directly in your view

Created 2 years ago by clapasTips4 comments – viewed 20,149 times – ( +3 / -2 ) – version 1.1
You usually take a model instance passed into your view to provide data to a CGridView in this way:

Styling Radio Buttons

Created 3 years ago by Steve FriedlTips4 comments – viewed 35,158 times – ( +15 ) – version 1.1
The default behavior with radio button lists is ugly, and I figured out mostly how to style them a coupla different ways. I'll used the blog tutorial example (but with my own posting modes):

Adding a date range search for CGridView the easy way

Created about a year ago by mikewalenTips4 comments – viewed 15,752 times – ( +10 ) – 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.

Send asset folder path to a javascript of a widget

Created 2 years ago by sensorarioTips4 comments – viewed 15,971 times – ( +4 ) – version 1.1
When you develop a widget, you could need one image that is in the assets folder, you can use it simply within a css. You can load a css or javascript script doing this:

Shrink Yii, help your IDE and speed up copying

Created 2 years ago by dckurushinTips4 comments – viewed 8,417 times – ( +10 / -9 ) – version 1.1
In this little tip, I will help you to cut Yii size for about half

how to use github (un)official extension repo in your Yii project

Created 2 years ago by RusAlexTips4 comments – viewed 6,956 times – ( +4 ) – version 1.1
Using a git submodule command in your yii project

Use application on production/development environment without making changes

Created 2 years ago by ifdatticTips3 comments – viewed 29,865 times – ( +8 / -1 ) – version 1.1
I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.

Directory independent extensions

Created 3 years ago by GOshaTips3 comments – viewed 8,404 times – ( +15 / -1 ) – version 1.1
Many people want to use downloaded extensions in their own way. As for me most of the extensions require me to correct Yii::import() instructions inside their source code. All these extensions are directory dependent. To avoid the situation described above, I suggest to implement pseudo-anonymous aliases: