Wiki

Sorted by commentsX
Displaying 71-80 of 483 result(s).

Local time zones and locales

Created 2 years ago by Russell EnglandHow-tos9 comments – viewed 31,857 times – ( +12 / -2 )
Following on from international dates, I also wanted times in the local timezone and format. This was a little more tricky but I think I've got a solution. This is only really appropriate if you have an international app.

How to show ajax delete status in CGridView like flash messages

Created 2 years ago by hasanaviHow-tos9 comments – viewed 19,593 times – ( +16 )
I've seen many tickets regarding how to show friendly delete confirmation using CGridView's CButtonColumn in ajax request. If you are using relational database, after producing CRUD functionality when you try to delete a record in ajax mode which has child record it can't be deleted and you can see the ajax loader forever. By this way you can't show the users if a record has been successfully deleted or if there are some problem in flash style (setFlash() / getFlash())

How to use the official Yii installer for Composer (**DEPRECATED**)

Created 2 months ago by br0skHow-tos9 comments – viewed 3,849 times – ( +3 )
This wiki shall be considered deprecated since the Yii installer for composer has been discontinued.

Using counters with ActiveRecord

Created about a year ago by davi_alexandreTips8 comments – viewed 10,525 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).

Use shortcut functions to reduce typing

Created 4 years ago by qiangTutorials8 comments – viewed 27,983 times – ( +48 )
Because Yii intends to be integrated nicely with third-party libraries, it does not define any global functions. Everything in Yii needs to be addressed with full class name or object scopes. For example, to access the current user, we need to use Yii::app()->user; to access application parameters, we need Yii::app()->params['name']; and so on. While editors like textmate can help alleviate the problem of these lengthy typings, it is worthwhile to define global shortcut functions to some commonly used method calls. They will make the application code look cleaner.

By Example: CHtml

Created 3 years ago by jonahTutorials8 comments – viewed 256,206 times – ( +84 )
"By Example" cookbook pages will provide coding examples for many of the commonly used classes within Yii. We will try to provide as many usage examples as possible for keep these pages as helpful as possible.

Update content in AJAX with renderPartial

Created 3 years ago by BurzumTutorials8 comments – viewed 91,551 times – ( +50 )
The easiest way to update content in AJAX is to use the renderPartial method.
tags: AJAX

Exporting CGridView results to CSV file

Created about a year ago by RusAlexTutorials8 comments – viewed 16,634 times – ( +6 / -2 )
A few days ago, i worked for CGridView exporting functional for my client. He asked me to create a simple exporting to a CSV file a CGridView search results.
tags: cgridview, export, csv

Creating a database-driven hierarchical Structure combined with CMenu and superfish

Created 3 years ago by thyseusTutorials8 comments – viewed 29,395 times – ( +15 )
Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!
tags: menu

Multiple-database support in Yii

Created 2 years ago by Steve FriedlHow-tos8 comments – viewed 37,897 times – ( +21 )
The customary configuration of a Yii application includes just a single database section in the protected/config/main.php file, but it's easy to extend this to support more than one, tying each Model to one of the databases.
tags: Database