Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 41-50 of 145 result(s).

1:n relations sometimes require CDbCriteria.together

Updated about a year ago by fsbTips5 comments – viewed 28,500 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.

Adding a date range search for CGridView the easy way

Updated about a year ago by mikewalenTips4 comments – viewed 19,407 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.

Set a menu - reusable code

Updated about a year ago by Kostas Apazidis (KonApaz)Tips0 comments – viewed 4,323 times – ( +1 )
As we know Using crud generator creates menu items in view files (for each view file have a varius menu items)

Rendering Views and Updating them with Ajax

Updated about a year ago by Manish GuptaTips4 comments – viewed 15,123 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.

How to upload image(photo), and path entry in database with update functionality

Updated about a year ago by ShahcheragheanTips17 comments – viewed 109,315 times – ( +36 / -3 ) – version 1.1
I saw many posts that community newbie is confuse in image/photo upload with random name. so I post this topic covering all useful things regarding to image/photo upload(not covering image attribute related functionality)

Multi Data Provider

Updated about a year ago by Sharon LavieTips0 comments – viewed 6,172 times – ( +1 )
Lately, i needed to deal with the following scenario: read from two databases (db1,db2), and write to a third database (db3).

How to call a default layout for every module and how to work <php echo $content; ?>

Updated about a year ago by Ankit ModiTips0 comments – viewed 14,416 times – ( -2 )
Hi Friends, Hi Friends, Some common question is difficult to how to create the layout on yii and how to work

Cgridview counter column

Updated about a year ago by trondTips4 comments – viewed 3,809 times – ( +8 )
some times we want to show the serialNo on cgridview .

How to preload dropdowns in CForm

Updated about a year ago by transistorTips0 comments – viewed 4,477 times – ( +1 )
So you want to use CForm (form builder), but need to preload dropdowns in a form? It's simpler than it seems. You got your CFormModel, CForm and the actual Form, right? Let's say you have the typical State -> City dependent dropdowns, so you would want to load the from with the State and City selected.

How to Display tooltp(qtip) on CGridview dynamic

Updated about a year ago by softarkTips1 comment – viewed 5,736 times – ( -1 )
Hi Friends,