SaveImgBehavior::className(), 'fields' => [ [ 'name' => 'image', 'directory' => 'article', ], ], ], 'language' => [ 'class' => LanguageBehavior::className(), ], [ 'class' => TimestampBehavior::className(), 'updatedAtAttribute' => false, ], ]; } /** * @inheritdoc */ public function rules() { return [ [ [ 'created_at' ], 'safe', ], [ [ 'created_at' ], 'filter', 'filter' => function($value) { return strtotime($value) ? : time(); }, ], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => Yii::t('app', 'ID'), 'created_at' => Yii::t('app', 'Date'), 'image' => Yii::t('app', 'Image'), 'imageUrl' => Yii::t('app', 'Image'), ]; } }