Commit 797936c7d4f2d7d5478fc61d4bdd299000183515

Authored by Alexey Boroda
1 parent 70753ad4

-Product video modified

controllers/ManageController.php
... ... @@ -105,6 +105,7 @@
105 105 {
106 106 $modelVideo = new ProductVideo();
107 107 $modelVideo->url = $video['url'];
  108 + $modelVideo->title = $video['title'];
108 109 $model->link('videos', $modelVideo);
109 110 }
110 111 }
... ... @@ -149,6 +150,7 @@
149 150 {
150 151 $modelVideo = new ProductVideo();
151 152 $modelVideo->url = $video['url'];
  153 + $modelVideo->title = $video['title'];
152 154 $model->link('videos', $modelVideo);
153 155 }
154 156 }
... ...
models/ProductVideo.php
... ... @@ -11,6 +11,7 @@
11 11 * @property integer $product_id
12 12 * @property string $url
13 13 * @property Product $product
  14 + * @property string $title
14 15 */
15 16 class ProductVideo extends ActiveRecord
16 17 {
... ... @@ -33,7 +34,10 @@
33 34 'integer',
34 35 ],
35 36 [
36   - [ 'url' ],
  37 + [
  38 + 'url',
  39 + 'title',
  40 + ],
37 41 'string',
38 42 'max' => 255,
39 43 ],
... ... @@ -56,6 +60,7 @@
56 60 'id' => \Yii::t('app', 'ID'),
57 61 'product_id' => \Yii::t('app', 'Product ID'),
58 62 'url' => \Yii::t('app', 'Url'),
  63 + 'title' => \Yii::t('app', 'Title'),
59 64 ];
60 65 }
61 66  
... ...
views/manage/_form.php
... ... @@ -104,7 +104,11 @@ $(".dynamicform_wrapper").on("limitReached", function(e, item) {
104 104 }
105 105 ?>
106 106 <div class="row">
107   - <div class="col-sm-11">
  107 + <div class="col-sm-4">
  108 + <?= $form->field($video, "[{$i}]title")
  109 + ->textInput([ 'maxlength' => true ]) ?>
  110 + </div>
  111 + <div class="col-sm-7">
108 112 <?= $form->field($video, "[{$i}]url")
109 113 ->textInput([ 'maxlength' => true ])->label('Iframe') ?>
110 114 </div>
... ...