Wiki

Articles in category "how-tos", sorted by ratingX
Displaying 21-30 of 182 result(s).

Keeping a running total in a CGridView

Created 2 years ago by Steve FriedlHow-tos3 comments – viewed 15,279 times – ( +21 )
This tip created in conjunction with IRC #yii channel users emilsedgh and tydeas - thanks!
tags: CGridView

Filter / Search with CListView

Created about a year ago by JohnPollardHow-tos5 comments – viewed 17,655 times – ( +21 )
This is what I did. Its the EASIEST solution that I know of. I just reused the advanced search done in CGridView.

Using Yii with PHP 5.4 built-in webserver instead of Apache

Created about a year ago by samdarkHow-tos1 comment – viewed 6,808 times – ( +20 )
Since version 5.4 PHP can work as a simple webserver so you can develop Yii applications without installing Apache. That's how to use it:

Avoiding rendering entire page when using CGridView and CListView via AJAX

Created 2 years ago by xrxHow-tos13 comments – viewed 22,280 times – ( +20 )
Since I used CGridView for a first time, I didn't like how it handled operations like sorting, filtering, changing page and etc using AJAX.

Integrating Wordpress and Yii: still another approach, using Yii as the router/controller

Created about a year ago by fr0d0zHow-tos12 comments – viewed 13,278 times – ( +19 )
A lot of people have written posts on integrating Yii and WordPress. This article combines goncin's approach with an article I read about integrating Symfony and WordPress and applies it all to Yii and WordPress.

Multiple-database support in Yii

Created 2 years ago by Steve FriedlHow-tos8 comments – viewed 36,038 times – ( +19 )
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

Dynamic Sidebar using CClipWidget

Created 2 years ago by SheldmanduHow-tos4 comments – viewed 15,018 times – ( +19 )
Most applications will have one or two sidebars and often you want to control the content that should appear in the sidebar based on the action. For example you will want to show something different on the homepage as opposed to some view page. While achieving this you generally also want to avoid putting the layout into each view, as that would mean if you wanted to change the layout (e.g. put the sidebar on the left instead of the right or do some funky layout which requires an additional div tag to be added) you'd have to go through every view, which does not achieve good code re-use. It is also bad practice to have lots of if statements in column2 layout just so that you can generate the sidebar correctly.

Implementing cron jobs with Yii

Created 2 years ago by samdarkHow-tos4 comments – viewed 28,947 times – ( +26 / -1 )
There are two ways to run a cron job:
tags: cron, cli

How to validate CSRF token with session

Created about a year ago by yangmlsHow-tos0 comments – viewed 17,671 times – ( +17 )
First of all, You must change component config to enable the default Yii CSRF validation.
tags: CSRF, session

Using Yii with Nginx and PHP-FPM

Created 2 years ago by LericHow-tos10 comments – viewed 25,788 times – ( +17 )
This config is built on an Ubuntu 11.04 server. Software is nginx, php-fpm (php5-fpm). For performance, it's recommended to run php-fpm in SOCKET mode, instead of accessing via IP:PORT. That is the method shown below.