diff --git a/backend/controllers/EventController.php b/backend/controllers/EventController.php index 6f37ce6..762a4b5 100755 --- a/backend/controllers/EventController.php +++ b/backend/controllers/EventController.php @@ -97,7 +97,7 @@ class EventController extends Controller { $model = $this->findModel($id); - if ($model->load(Yii::$app->request->post()) && $model->save()) { + if ($model->load(Yii::$app->request->post())) { if ( ($image = UploadedFile::getInstance($model, 'image')) ) { $model->image = $image->name; } diff --git a/backend/views/event/_form.php b/backend/views/event/_form.php index a878407..8c82dad 100755 --- a/backend/views/event/_form.php +++ b/backend/views/event/_form.php @@ -11,8 +11,7 @@ use mihaildev\elfinder\ElFinder; ?>
- - + ['enctype' => 'multipart/form-data']]); ?> field($model, 'name')->textInput(['maxlength' => true]) ?> diff --git a/backend/views/event/view.php b/backend/views/event/view.php index a3d8067..78b8536 100755 --- a/backend/views/event/view.php +++ b/backend/views/event/view.php @@ -32,10 +32,6 @@ $this->params['breadcrumbs'][] = $this->title; 'name', 'alias', 'body:ntext', - [ - 'format' => 'image', - 'attribute'=>'image', - ], 'meta_title', 'description', 'h1', diff --git a/common/models/Event.php b/common/models/Event.php index b05a0c4..067bf70 100755 --- a/common/models/Event.php +++ b/common/models/Event.php @@ -76,6 +76,7 @@ class Event extends \yii\db\ActiveRecord [['created_at', 'updated_at' ], 'integer'], [['name', 'alias', 'image', 'meta_title', 'description', 'h1','end_at'], 'string', 'max' => 255], [['name','body'], 'required'], + [['image'], 'file'], ]; } -- libgit2 0.21.4