示例#1
0
 public function behaviors()
 {
     $behaviors = array_merge(parent::behaviors(), array('CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior', 'createAttribute' => 'created_at', 'updateAttribute' => 'updated_at', 'setUpdateOnCreate' => true, 'timestampExpression' => 'date("Y-m-d H:i:s");')));
     return $behaviors;
 }
示例#2
0
 public function behaviors()
 {
     $behaviors = array_merge(parent::behaviors(), array('CategoryTreeBehavior' => array('class' => 'yupe.components.behaviors.CategoryTreeBehavior', 'aliasAttribute' => 'alias', 'defaultCriteria' => array('order' => ' t.sort ASC, t.title ASC'))));
     return $behaviors;
 }
示例#3
0
 public function behaviors()
 {
     $behaviors = array_merge(parent::behaviors(), array('CategoryTreeBehavior' => array('class' => 'yupe.components.behaviors.CategoryTreeBehavior', 'aliasAttribute' => 'alias', 'defaultCriteria' => array('order' => ' t.sort ASC, t.title ASC')), 'CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior', 'createAttribute' => 'created_at', 'updateAttribute' => 'updated_at', 'setUpdateOnCreate' => true)));
     return $behaviors;
 }
 public function behaviors()
 {
     $behaviors = array_merge(parent::behaviors(), array('CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior', 'createAttribute' => 'created_at', 'updateAttribute' => 'updated_at', 'setUpdateOnCreate' => true)));
     return $behaviors;
 }
示例#5
0
 public function behaviors()
 {
     $module = Yii::app()->getModule('service');
     $behaviors = array_merge(parent::behaviors(), array('imageUpload' => array('class' => 'yupe\\components\\behaviors\\ImageUploadBehavior', 'scenarios' => array('insert', 'update'), 'attributeName' => 'image', 'minSize' => $module->minSize, 'maxSize' => $module->maxSize, 'types' => $module->allowedExtensions, 'uploadPath' => $module->uploadPath), 'CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior', 'createAttribute' => 'created_at', 'updateAttribute' => 'updated_at', 'setUpdateOnCreate' => true)));
     return $behaviors;
 }