yii, How to automate timestamps in ActiveRecord models

There are many ways to automate the setting of timestamps in yii ActiveRecord models. Two of them are: Via rules() Via beforeSave() To start off we need to create a database table. CREATE TABLE IF NOT EXISTS `Nodes` ( `id` bigint(20) NOT NULL auto_increment, `title` varchar(255) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT… Continue reading yii, How to automate timestamps in ActiveRecord models

yii, Organize directories for applications with front-end and back-end

Large applications are often divided into front-end and back-end (or even more ends) depending on the target user groups. The front-end should be used by common users, while the back-end mainly the administrators or staff members. The two ends usually have dramatically different appearance, even though they may share a lot of code underneath. In… Continue reading yii, Organize directories for applications with front-end and back-end

yii, easy and simple user role management using yii’s AuthManager

Step 1 :  Create table : CREATE TABLE User( `id` INT(11) NOT NULL AUTO_INCREMENT,`username` VARCHAR(45),`password` VARCHAR(254),`title` VARCHAR(45),PRIMARY KEY(`id`))ENGINE = MyISAM; Step 2 : Add following code in config/main.php ‘authManager’=>array( ‘class’=>’CDbAuthManager’, ‘defaultRoles’=>array(‘authenticated’, ‘guest’), ), Below this code ‘db’=>array( ‘connectionString’ => ‘mysql:host=localhost;dbname=comocomo’, ’emulatePrepare’ => true, ‘username’ => ‘root’, ‘password’ => ‘abc123’, ‘charset’ => ‘utf8’, ), Step 3:… Continue reading yii, easy and simple user role management using yii’s AuthManager