Skip to content

Commit

Permalink
Add show_published_at to form and model
Browse files Browse the repository at this point in the history
  • Loading branch information
saiat3 committed May 2, 2018
1 parent 897d4e1 commit f514c0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @property integer $updater_id
* @property integer $status
* @property integer $published_at
* @property integer $show_published_at
* @property integer $position
* @property integer $created_at
* @property integer $updated_at
Expand Down Expand Up @@ -145,6 +146,7 @@ public function rules()
[['view'], 'string', 'max' => 255],
[['attachments', 'thumbnail', 'published_at'], 'safe'],
['category_ids', 'each', 'rule' => ['integer']],
['show_published_at', 'boolean'],
];
}

Expand All @@ -165,6 +167,7 @@ public function attributeLabels()
'updater_id' => Yii::t('i18ncontent', 'Updater'),
'status' => Yii::t('i18ncontent', 'Published'),
'published_at' => Yii::t('i18ncontent', 'Published At'),
'show_published_at' => Yii::t('i18ncontent', 'Show published at'),
'created_at' => Yii::t('i18ncontent', 'Created At'),
'updated_at' => Yii::t('i18ncontent', 'Updated At')
];
Expand Down
2 changes: 2 additions & 0 deletions views/article/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
]
) ?>

<?php echo $form->field($model,'show_published_at')->checkbox() ?>

<div class="form-group pull-left margin-right-5">
<?php echo Html::submitButton(
$model->isNewRecord ? Yii::t('i18ncontent', 'Create') : Yii::t('i18ncontent', 'Update'),
Expand Down

0 comments on commit f514c0a

Please sign in to comment.