Wiki

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

using multiple radio button

Created 2 years ago by francis jaTips4 comments – viewed 31,560 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().

Customizing the CMenu Widget

Created about a year ago by mistrybTips1 comment – viewed 30,640 times – ( +5 / -1 ) – version 1.1
The CMenu class provides some useful features for generating menus in your web application.

Assigning dynamic roles to a user Using yii Rights module at the time of user creation and using some special advanced features of yii rights

Created about a year ago by Rajith RTips20 comments – viewed 30,080 times – ( +11 / -8 ) – version 1.1
After Installing Yii Users and Rights to Newly Created Yii app we have to assign dynamic roles to a user at the time of user creation .

A simple action for CJuiAutoComplete

Created 3 years ago by tydeas_drTips9 comments – viewed 29,742 times – ( +16 / -1 ) – version 1.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?

Using CJuiDialog to edit rows in a CGridView

Created 3 years ago by Russell EnglandTips8 comments – viewed 27,836 times – ( +4 / -1 ) – version 1.1
I have a CGridView with a list of clients/events. For each row (EventClient) I wanted a quick edit dialog.

Display a nice exception message on ajax requests

Created 3 years ago by Maurizio Domba CerinTips3 comments – viewed 27,689 times – ( +13 ) – version 1.1
When an exception is thrown in our code like
tags: error, exception

1:n relations sometimes require CDbCriteria.together

Created 3 years ago by fsbTips5 comments – viewed 27,286 times – ( +16 ) – version 1.1
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.

An easy way to display a success page using flash messages

Created 3 years ago by qiangTips2 comments – viewed 26,372 times – ( +26 ) – version 1.1
We often need to display a success page after the user has submitted a form without problem. We may show some welcome message after a user registers a new account. There are many ways to implement this workflow. In this article, I will explain a method that exploits flash messages.

Putting Function To Be Called In View

Created 3 years ago by junxiongTips2 comments – viewed 25,432 times – ( +6 / -1 ) – version 1.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

Quick Tip about Pagination Params

Created 4 years ago by Antonio RamirezTips2 comments – viewed 25,025 times – ( +6 ) – version 1.1
Developing custom Grids and ListViews for my new CMS I was facing a small challenge: If I was to update/delete/batch delete items of my Grid, how would I return to the current page view?
tags: Pagination