Code from Yii Framework tutorial (Web Application Development with Yii and PHP, 2nd Edition)