Wiki

Articles in category "how-tos", sorted by commentsX
Displaying 11-20 of 352 result(s).

Using CButtonColumn to customize buttons in CGridView

Created 5 years ago by TrejderHow-tos18 comments – viewed 265,199 times – ( +101 ) – version 1.1
CGridView is a one of most flexible widgets in Yii and example its flexibility is CButtonColumn used to build buttons for steering model in each grid row. Here in this how-to we will explain ways user can customize CButtonColumn to flexibly fit it to its needs.

Multiple-database support in Yii

Created 5 years ago by Steve FriedlHow-tos18 comments – viewed 97,659 times – ( +29 ) – version 1.1
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

Authenticating against phpass hashes with Yii

Created 4 years ago by Da:SourcererHow-tos18 comments – viewed 26,710 times – ( +26 ) – version 1.1
Note: This guide is outdated as of Yii v1.1.14 which introduced the CPasswordHelper class. Please use that instead.

How to setup RBAC with a php file

Created 6 years ago by bettorHow-tos17 comments – viewed 62,061 times – ( +26 / -5 ) – version 1.1
In this cookbook I will attempt to explain how to use the lightweight version of Role-Based Access Control using a php file. This version does not use database but a php file and is controlled by CPhpAuthManager class.

Avoiding rendering entire page when using CGridView and CListView via AJAX

Created 5 years ago by xrxHow-tos17 comments – viewed 38,744 times – ( +24 ) – version 1.1
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.

Handling Bootstrap active tabs in Yii via URL

Created 3 years ago by JamesBarnsleyHow-tos17 comments – viewed 24,765 times – ( +7 ) – version 1.1
I (www.jamesbarnsley.com) found that when using the Yii Bootstrap tabs component you will sometimes want to direct the user to a specific tab and not necessarily the first tab. Yii Bootstrap already provides the "active" variable so you can define whether the tab is the active tab or not in PHP. I generally find though that a PHP solution to this problem is rather cumbersome as every tab component will need the PHP code inserted or you will have to extend the tab component somehow to do it.

Real-time display of server push data using Server-Sent Events (SSE)

Created 4 years ago by bennounaHow-tos16 comments – viewed 42,688 times – ( +12 ) – version 1.1
There are several methods and techniques that come handy in the case you need to call an external resource periodically or if you are waiting for a server push, but I present here an easy and straightforward one using HTML5's Server-Sent Events (SSE).

Uploading multiple images with CMultiFileUpload

Created 5 years ago by rsinghHow-tos16 comments – viewed 96,936 times – ( +38 ) – version 1.1
"The documentation for CMultiFileUpload isn't clear!"

Url: hide index.php

Created 5 years ago by HermansHow-tos16 comments – viewed 158,846 times – ( +28 / -1 ) – version 1.1
Maybe it looks simple, but some time ago I need some time to find a solution of this case. I finally got it, and I want to share that I also experienced such cases. So that it can make reference.

How to use a Widget as an Action Provider

Created 5 years ago by Antonio RamirezHow-tos15 comments – viewed 40,066 times – ( +27 ) – version 1.1
As written on the API docs: An Action Provider Widget is a widget that has declared several actions by using its 'public static function actions()'. After, a Controller can easily import all its declared actions on its 'public function actions()'.
tags: Widgets, CAction