Wiki

Displaying 321-330 of 771 result(s).

How to use a component before every action of a controller

Created 3 years ago by transistorTips1 comment – viewed 29,649 times – ( +2 / -1 ) – version 1.1
I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.

How to implement an event and attach it in a behavior

Created 3 years ago by seb7How-tos0 comments – viewed 15,828 times – ( +6 ) – version 1.1
This page explains how to implement an event and catch that event in a behavior.
tags: event, behavior

Yet another implementation of CPhpAuthManager.

Created 3 years ago by seenivasanHow-tos3 comments – viewed 11,034 times – ( +8 / -1 ) – version 1.1
In this wiki, I try to implement a simple authorization schema without putting much logic inside a file or into database table. We are constructing authorization hierarchy inside the controller. We are getting roles for the current user from database table and assigning only roles to user that are declared in the particular controller. We have brought down the work of loading of auth data at main application level to controller level. This way we have pulverised auth data for entire site into smaller units. Finally we are going to look at couple of examples.

CGridView: Adding behaviors from configuration, and template items from behaviors to CGridView

Created 3 years ago by le_topTips0 comments – viewed 8,630 times – ( +5 ) – version 1.1
Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it. I am surprised that this is not in the default implementation, so I made my default CGridView implementation.

Alternative folder structure for a standard Yii app

Created 3 years ago by TrejderHow-tos4 comments – viewed 12,694 times – ( +5 ) – version 1.1
I found a standard Yii app's protected folder structure nearly perfect. With a few simple moves and a little bit change to the code, I managed to bring it to the level, which I found as fully perfect. I want to share my point of view, in case someone would like to use this structure as well.

How to change Migration Table name and use defined prefix.

Created 3 years ago by JorgeeHow-tos1 comment – viewed 9,277 times – ( +3 ) – version 1.1
To accomplish the task of changing Migration table's name, by default tbl_migration, you need to add the following in your ./protected/config/console.php.

Using Google Maps in Yii Applications via Jquery

Created 3 years ago by bluyellHow-tos2 comments – viewed 14,000 times – ( +2 / -1 ) – version 1.1

Implementing a Flat User Access System

Created 3 years ago by TrejderHow-tos1 comment – viewed 10,129 times – ( +9 ) – version 1.1
This article shows a quick and easy way to implement flat user access control system. Flat means, that user access is controlled by level only, which is solution exactly opposite to complex RBAC access systems.

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

Created 3 years ago by br0skHow-tos9 comments – viewed 35,421 times – ( +3 ) – version 1.1
This wiki shall be considered deprecated since the Yii installer for composer has been discontinued.