Commit 797936c7d4f2d7d5478fc61d4bdd299000183515

Authored by Alexey Boroda
1 parent 70753ad4

-Product video modified

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