diff --git a/controllers/ManageController.php b/controllers/ManageController.php index 2701cb8..d8facaa 100755 --- a/controllers/ManageController.php +++ b/controllers/ManageController.php @@ -105,6 +105,7 @@ { $modelVideo = new ProductVideo(); $modelVideo->url = $video['url']; + $modelVideo->title = $video['title']; $model->link('videos', $modelVideo); } } @@ -149,6 +150,7 @@ { $modelVideo = new ProductVideo(); $modelVideo->url = $video['url']; + $modelVideo->title = $video['title']; $model->link('videos', $modelVideo); } } diff --git a/models/ProductVideo.php b/models/ProductVideo.php index f13fb22..53ef4e9 100644 --- a/models/ProductVideo.php +++ b/models/ProductVideo.php @@ -11,6 +11,7 @@ * @property integer $product_id * @property string $url * @property Product $product + * @property string $title */ class ProductVideo extends ActiveRecord { @@ -33,7 +34,10 @@ 'integer', ], [ - [ 'url' ], + [ + 'url', + 'title', + ], 'string', 'max' => 255, ], @@ -56,6 +60,7 @@ 'id' => \Yii::t('app', 'ID'), 'product_id' => \Yii::t('app', 'Product ID'), 'url' => \Yii::t('app', 'Url'), + 'title' => \Yii::t('app', 'Title'), ]; } diff --git a/views/manage/_form.php b/views/manage/_form.php index 2ad795d..5f82248 100755 --- a/views/manage/_form.php +++ b/views/manage/_form.php @@ -104,7 +104,11 @@ $(".dynamicform_wrapper").on("limitReached", function(e, item) { } ?>
-
+
+ field($video, "[{$i}]title") + ->textInput([ 'maxlength' => true ]) ?> +
+
field($video, "[{$i}]url") ->textInput([ 'maxlength' => true ])->label('Iframe') ?>
-- libgit2 0.21.4