Commit 64f417aa by dianc

Category Updated-3

parent 7bd28bad
......@@ -2,6 +2,7 @@
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use trntv\filekit\widget\Upload;
/* @var $this yii\web\View */
/* @var $model common\models\Category */
......@@ -31,10 +32,11 @@ use yii\bootstrap\ActiveForm;
<?= $form->field($model, 'status')->dropDownList($model::statuses(), ['prompt' => '']) ?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'image')->widget(
\trntv\filekit\widget\Upload::className(),
Upload::className(),
[
'url' => ['/file-storage/upload'],
])->label('Image(1280x854)');
......
......@@ -2,6 +2,8 @@
use yii\helpers\Html;
use yii\grid\GridView;
use common\grid\EnumColumn;
use common\models\Category;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\theme\models\search\CategorySearch */
......@@ -26,12 +28,18 @@ $this->params['breadcrumbs'][] = $this->title;
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
//'id',
'name',
'slug',
// 'slug',
'description',
'image_url:url',
// 'image_url:url',
// 'image_path',
[
'class' => EnumColumn::className(),
'attribute' => 'status',
'enum' => Category::statuses(),
'filter' => Category::statuses()
],
// 'status',
// 'created_at',
// 'updated_at',
......
......@@ -49,6 +49,7 @@ class Category extends \yii\db\ActiveRecord
[['name', 'slug'], 'string', 'max' => 32],
[['description'], 'string', 'max' => 512],
[['image_url', 'image_path'], 'string', 'max' => 1024],
[['image'], 'safe']
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment