Posts Tagged “yii”

Custom Yii Rule for Unique Attribute Validation

By | January 19, 2012

You’ve probably seen it or experienced at some point when registering for a site where you must pick a unique username or subdomain for account registration. However, this is can be tedious to implement in both frameworks and non-framework solutions. Luckily, Yii has validation rules that can be implemented easily and can be user-defined for [...]

Read more »

Get Name of Current Controller and Action in Yii

By | December 5, 2011

This is a simple one line piece of code to retrieve the name of the current controller, which is great for making more generic and useful code. $controllerName = Yii::app()->controller->id;

Read more »