コード例 #1
0
ファイル: Page.php プロジェクト: rocketyang/hasscms-app
 public function behaviors()
 {
     $behaviors = [];
     $behaviors['commentEnabled'] = ['class' => \hass\comment\behaviors\CommentBehavior::className(), 'defaultStatus' => \hass\comment\enums\CommentEnabledEnum::STATUS_ON, 'entityClass' => 'hass\\page\\models\\Page'];
     $behaviors['meta'] = ['class' => \hass\meta\behaviors\MetaBehavior::className(), 'entityClass' => 'hass\\page\\models\\Page'];
     $behaviors["TimestampFormatter"] = TimestampFormatter::className();
     return $behaviors;
 }
コード例 #2
0
ファイル: Post.php プロジェクト: rocketyang/hasscms-app
 public function behaviors()
 {
     $behaviors = [];
     $behaviors["thumbnailFile"] = ['class' => \hass\attachment\behaviors\UploadBehavior::className(), 'attribute' => 'thumbnail', 'entityClass' => 'hass\\post\\models\\Post'];
     $behaviors['taxonomy'] = ['class' => \hass\taxonomy\behaviors\TaxonomyBehavior::className(), 'root' => 'xin-wen', 'entityClass' => 'hass\\post\\models\\Post'];
     $behaviors['taggabble'] = ['class' => \hass\tag\behaviors\Taggable::className(), 'entityClass' => 'hass\\post\\models\\Post'];
     $behaviors['commentEnabled'] = ['class' => \hass\comment\behaviors\CommentBehavior::className(), 'defaultStatus' => \hass\comment\enums\CommentEnabledEnum::STATUS_ON, 'entityClass' => 'hass\\post\\models\\Post'];
     $behaviors['meta'] = ['class' => \hass\meta\behaviors\MetaBehavior::className(), 'entityClass' => 'hass\\post\\models\\Post'];
     $behaviors["TimestampFormatter"] = TimestampFormatter::className();
     return $behaviors;
 }
コード例 #3
0
ファイル: Page.php プロジェクト: hassiumsoft/hasscms-packages
 public function behaviors()
 {
     $behaviors = ['sluggable' => ['class' => SluggableBehavior::className(), 'attribute' => 'title', 'ensureUnique' => true, "immutable" => true], SetMaxSortableModel::className()];
     $behaviors['timestamp'] = TimestampBehavior::className();
     $behaviors['published_at'] = ['class' => \hass\base\behaviors\StrToTimeBehavior::className(), "attribute" => "published_at"];
     $behaviors["meta"] = MetaBehavior::className();
     $behaviors["thumbnailFile"] = ['class' => \hass\attachment\behaviors\UploadBehavior::className(), 'attribute' => 'thumbnail'];
     $behaviors["textEditor"] = ['class' => \hass\base\misc\editor\EditorBehavior::className(), 'attribute' => 'content'];
     $behaviors["TimestampFormatter"] = TimestampFormatter::className();
     $behaviors["commentEnabled"] = ['class' => CommentBehavior::className(), 'defaultStatus' => CommentEnabledEnum::STATUS_ON];
     return $behaviors;
 }
コード例 #4
0
ファイル: Post.php プロジェクト: rocketyang/hasscms-app
 public function behaviors()
 {
     $behaviors = ['sluggable' => ['class' => SluggableBehavior::className(), 'attribute' => 'title', 'ensureUnique' => true, "immutable" => true]];
     $behaviors['author_id'] = ['class' => BlameableBehavior::className(), 'attributes' => [static::EVENT_BEFORE_INSERT => 'author_id']];
     $behaviors['timestamp'] = TimestampBehavior::className();
     $behaviors['published_at'] = ['class' => StrToTimeBehavior::className(), 'attribute' => 'published_at'];
     $behaviors['taggabble'] = Taggable::className();
     $behaviors['meta'] = MetaBehavior::className();
     $behaviors['thumbnailFile'] = ['class' => \hass\attachment\behaviors\UploadBehavior::className(), 'attribute' => 'thumbnail'];
     $behaviors['taxonomy'] = ['class' => TaxonomyBehavior::className()];
     $behaviors['textEditor'] = ['class' => \hass\base\misc\editor\EditorBehavior::className(), 'attribute' => 'content'];
     $behaviors['TimestampFormatter'] = TimestampFormatter::className();
     $behaviors['commentEnabled'] = ['class' => CommentBehavior::className(), 'defaultStatus' => CommentEnabledEnum::STATUS_ON];
     return $behaviors;
 }
コード例 #5
0
ファイル: Comment.php プロジェクト: rocketyang/hasscms-app
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [TimestampBehavior::className(), TimestampFormatter::className(), ["class" => BlameableBehavior::className(), "attributes" => [static::EVENT_BEFORE_INSERT => "author_id"]]];
 }
コード例 #6
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     $behaviors = array_merge(parent::behaviors(), [TimestampFormatter::className()]);
     $behaviors['avatarImage'] = ['class' => \hass\attachment\behaviors\UploadBehavior::className(), 'attribute' => 'avatarImage'];
     return $behaviors;
 }