@ -26,6 +26,7 @@ class BlogPostForm extends CompositeForm
public $published_at;
public $slug;
public $reset_image;
public $status;
public $_post;
@ -41,10 +42,12 @@ class BlogPostForm extends CompositeForm
$this->slug = $post->slug;
$this->meta = new MetaForm($post->meta);
$this->tags = new BlogTagForm($post);
$this->status = $post->status;
$this->_post = $post;
} else {
$this->meta = new MetaForm();
$this->tags = new BlogTagForm();
$this->status = 0;
}
parent::__construct($config);
}
@ -54,7 +57,7 @@ class BlogPostForm extends CompositeForm
return [
[['category_id', 'title'], 'required'],
[['title', 'video'], 'string', 'max' => 255],
[['category_id'], 'integer'],
[['category_id', 'status' ], 'integer'],
[['description', 'content'], 'string'],
[['image'], 'image'],
['reset_image', 'boolean'],