Wiki

Articles in category "tips", sorted by viewsX
Displaying 21-30 of 103 result(s).

An Easy Solution for Dependent dropDownList Using AJAX

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

Display a nice exception message on ajax requests

Created about a year ago by Maurizio DombaTips1 comment – viewed 15,794 times – ( +11 )
When an exception is thrown in our code like
tags: error, exception

Search method of a model for filters when using dates - unixtimestamp in database

Created 2 years ago by MukkeTips1 comment – viewed 15,381 times – ( +10 )
I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.

using multiple radio button

Created about a year ago by francis jaTips2 comments – viewed 15,190 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().

Importing CSV file to mysql table using "LOAD DATA" command.

Created about a year ago by sirin kTips10 comments – viewed 15,055 times – ( +5 )
hi, Here i am giving you some simple step to import huge data from a csv file to your mysql table.this is useful when you have a very huge data to import from csv format.
tags: csv, mysql, import

How to filter CGridView with From Date and To Date datepicker

Created 11 months ago by kiran sharmaTips10 comments – viewed 14,635 times – ( +11 )
This artical is related to allow user to filter CGridView with date range using datepicker on submit button. Here I use Yii Cookie to preserve date in datepicker textbox after submitting the form.

Putting Function To Be Called In View

Created 2 years ago by junxiongTips2 comments – viewed 14,597 times – ( +5 / -1 )
Sometimes we need some complicated view to be displayed (such as generating complicated table). Most people suggest that in MVC the View must be as simple as possible (don't have too much loops, etc). So what we have to do is to hide away the complex code by putting it at somewhere else. The following are few places options to keep the function:
tags: view, render

1:n relations sometimes require CDbCriteria.together

Created about a year ago by fsbTips4 comments – viewed 14,549 times – ( +13 )
There are situations in which Active Record will generate nonsense queries from what a nieve Yii user might think is reasonable code. One such situation is a CActiveDataProvider using CDbCriteria to get data from parent and 1:n child table with a condition on the child table.

Extending common classes to allow better customization

Created 2 years ago by Steve FriedlTips0 comments – viewed 14,483 times – ( +38 )
The two most commonly-used base classes in most Yii applications are CController and CActiveRecord, each extended to your own particular models and controllers.

An easy way to use escopes and CActiveDataProvider

Created 2 years ago by Rafael GarciaTips8 comments – viewed 14,385 times – ( +1 / -1 )
Often used scopes to define criteria in our models. This is a very useful feature as it ensures that in any part of application applying the criteria defined by the scope when called it.