Wiki

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

A simple action for CJuiAutoComplete

Created 2 years ago by tydeas_drTips7 comments – viewed 17,720 times – ( +14 / -1 )
More or less I use auto-complete field for a form. CJuiAutoComplete is a yii widget for this purposes. The common use case is to make an ajax request and retrieve a list from the database. So in this case you have to write a controller action to return you a json encoded list. What if I had a generic action to do this work for me?

Change buttons on our CGridView extending yii

Created about a year ago by sensorarioTips4 comments – viewed 13,557 times – ( +9 )
In this tip, I'll help you to change in few second buttons of your CGridView. I hope you like it =).

A simple class to use a different db for a module

Created 2 years ago by tydeas_drTips2 comments – viewed 8,487 times – ( +8 )
What would you do if you want/need to have a different than the main database connection in an module's models?

Using events with CAction classes

Created about a year ago by Antonio RamirezTips0 comments – viewed 7,520 times – ( +8 )
There are some good guides out there explaining how to work with events and the ways to attach them to your components, but none (that I know) explain the following way to configure your events with CAction classes on your controllers the following way.

BootProgressColumn - Progress Bar Inside GridView Column compatible with 'bootstrap' extension

Created 10 months ago by LuizTips1 comment – viewed 5,887 times – ( +6 )
A little hint of how to create a progress bar inside the column of the grid, using the 'bootstrap' extension.

An Easy Solution for Dependent dropDownList Using AJAX

Created 5 months ago by mrsTips5 comments – viewed 13,040 times – ( +6 )
Sometimes new Yii guys face problem to manage dependent dropDownList using AJAX. I am going to discuss an easy solution about this issue.

Adding a date range search for CGridView the easy way

Created 2 months ago by mikewalenTips2 comments – viewed 3,622 times – ( +6 )
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.

Using counters with ActiveRecord

Created about a year ago by davi_alexandreTips8 comments – viewed 9,822 times – ( +9 / -1 )
Let's say, for example, that you are developing a blog or some kind of CMS and you want to track the number of times each post was viewed (maybe to show a list of the most viewed ones).

Integrating Yii with Wordpress

Created about a year ago by isekreamTips4 comments – viewed 21,262 times – ( +9 / -1 )
Well I finally had some time and tinkered a bit with the notion of integrating wordpress and Yii. Now for me I wanted to use Yii as a framework to develop wordpress plugins. Using some tips from imasia Article I was able to do a simple integration of yii as a wordpress plugin. The integration was very basic and i just used yii with its default installation site. I don;t know how it will really react with CRUD application as yet but it was fairly easy to integrate after reading the article...

using multiple radio button

Created about a year ago by francis jaTips2 comments – viewed 14,363 times – ( +5 )
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().