Beispiel #1
0
 /**
  * Returns a list of behaviors that this component should behave as.
  * @return array
  */
 public function behaviors()
 {
     return ['blameable' => ['class' => BlameableBehavior::className(), 'createdByAttribute' => 'createdBy', 'updatedByAttribute' => 'updatedBy'], 'timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['createdAt'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updatedAt']]], 'purify' => ['class' => PurifyBehavior::className(), 'attributes' => ['content']]];
 }
Beispiel #2
0
 /**
  * Returns a list of behaviors that this component should behave as.
  *
  * @return array
  */
 public function behaviors()
 {
     return ['blameable' => ['class' => BlameableBehavior::className(), 'createdByAttribute' => 'createdBy', 'updatedByAttribute' => 'updatedBy'], 'timestamp' => ['class' => TimestampBehavior::className(), 'createdAtAttribute' => 'createdAt', 'updatedAtAttribute' => 'updatedAt'], 'purify' => ['class' => PurifyBehavior::className(), 'attributes' => ['content'], 'config' => ['HTML.SafeIframe' => true, 'URI.SafeIframeRegexp' => '%^(https?:)?//(www\\.youtube(?:-nocookie)?\\.com/embed/|player\\.vimeo\\.com/video/)%', 'AutoFormat.Linkify' => true, 'HTML.TargetBlank' => true, 'HTML.Allowed' => 'a[href], iframe[src|width|height|frameborder], img[src]']]];
 }
Beispiel #3
0
 /**
  * Returns a list of behaviors that this component should behave as.
  * @return array
  */
 public function behaviors()
 {
     return ['blameable' => ['class' => BlameableBehavior::className(), 'createdByAttribute' => 'createdBy', 'updatedByAttribute' => 'updatedBy'], 'timestamp' => ['class' => TimestampBehavior::className(), 'createdAtAttribute' => 'createdAt', 'updatedAtAttribute' => 'updatedAt'], 'purify' => ['class' => PurifyBehavior::className(), 'attributes' => ['content']]];
 }
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['timestamp' => ['class' => 'yii\\behaviors\\TimestampBehavior', 'createdAtAttribute' => 'createdAt', 'updatedAtAttribute' => 'updatedAt'], 'purify' => ['class' => PurifyBehavior::className(), 'attributes' => ['title', 'description']]];
 }