Cook your own User Authentication in Yii – Part 1

This is the first of  four articles demonstrating how to build your own simple User Authentication system by extending core Yii classes and just a few views. There are a number of Extensions, Modules and RBAC systems available in the Yii extensions directory and, of...

Yii – Maintaining created and updated date

A very simple way to maintain date-time stamps on records is to use the behaviors method in the data Model, linked with the CTimestampbehavior within Zii widgets. To implement this, in each of your data models, use a behaviors function as follows:- public function...

Yii – Converting MySql dates to locale dates

It seems strange to me that two systems that have been around for so long and worked so closely together, do not manipulate dates in the same way. It is also so easy to waste hours of time trying to manipulate dates, check that date A is less than date B and so...

Yii – Further model validation

UPDATED 26-Jan-2012 ! A brief note today to add some more specific validation to your models.  As we all know – “rubbish in == rubbish out”, so let’s get that data nice and clean, right up front! public function rules() { // NOTE: you should...

Yii – Relations using a non-primary key

Often mistakes you make in your database design stage come around and bite you in the butt later! My Mistake I’m just testing a new reservation system that should be going live soon and it’s looking really good, expected results are bang on, the system is...