[ 'enctype' => 'multipart/form-data' ], ] ); ?> $modelLangs, 'formView' => '@artbox/weblog/views/blog-article/_form_language', 'form' => $form, ] ); ?> field($model, 'blogCategories') // ->widget( // Select2::className(), // [ // 'data' => $categories, // 'theme' => Select2::THEME_BOOTSTRAP, // 'options' => [ // 'placeholder' => \Yii::t('blog', 'Select category'), // 'multiple' => true, // ], // 'pluginOptions' => [ // 'allowClear' => true, // ], // ] // ); ?> field($model, 'blogTags') // ->widget( // Select2::className(), // [ // 'data' => $tags, // 'theme' => Select2::THEME_BOOTSTRAP, // 'options' => [ // 'placeholder' => \Yii::t('blog', 'Select tag'), // 'multiple' => true, // ], // 'pluginOptions' => [ // 'allowClear' => true, // ], // ] // ); ?> field($model, 'image_id') ->widget( ImageManagerInputWidget::className(), [ 'aspectRatio' => ( 16 / 9 ), //set the aspect ratio 'showPreview' => true, //false to hide the preview 'showDeletePickedImageConfirm' => false, //on true show warning before detach image ] ); ?> field($model, 'products') // ->widget( // Select2::className(), // [ // 'data' => $products, // 'options' => [ // 'placeholder' => \Yii::t('blog', 'Select related products'), // 'multiple' => true, // ], // 'pluginOptions' => [ // 'allowClear' => true, // 'minimumInputLength' => 3, // 'language' => [ // 'errorLoading' => new JsExpression( // "function () { return '" . \Yii::t('blog', 'Waiting for results') . "'; }" // ), // ], // 'ajax' => [ // 'url' => yii\helpers\Url::to([ '/blog/blog-article/product-list' ]), // 'dataType' => 'json', // 'data' => new JsExpression('function(params) { return {q:params.term}; }'), // ], // 'templateResult' => new JsExpression('function(product) { return product.text; }'), // 'templateSelection' => new JsExpression('function (product) { return product.text; }'), // ], // ] // ); ?> id )) { // $data = 'function(params) { return {q:params.term}; }'; // } else { // $data = 'function(params) { return {q:params.term, id:' . $model->id . '}; }'; // } // echo $form->field($model, 'blogArticles') // ->widget( // Select2::className(), // [ // 'data' => $articles, // 'options' => [ // 'placeholder' => \Yii::t('blog', 'Select related articles'), // 'multiple' => true, // ], // 'pluginOptions' => [ // 'allowClear' => true, // 'minimumInputLength' => 3, // 'language' => [ // 'errorLoading' => new JsExpression( // "function () { return '" . \Yii::t('blog', 'Waiting for results') . "'; }" // ), // ], // 'ajax' => [ // 'url' => yii\helpers\Url::to([ '/blog/blog-article/article-list' ]), // 'dataType' => 'json', // 'data' => new JsExpression( // $data // ), // ], // 'templateResult' => new JsExpression('function(article) { return article.text; }'), // 'templateSelection' => new JsExpression('function (article) { return article.text; }'), // ], // ] // ); ?> field($model, 'sort') ->textInput() ?> field($model, 'status') ->checkbox( [ 'class' => 'flat', ] ) ?> field($model, 'author_id') ->textInput() ?>
isNewRecord ? 'Create' : 'Update', [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ] ) ?>