_post)) { $tagsJson = \yii\helpers\Json::encode( \yii\helpers\Json::encode( \yii\helpers\ArrayHelper::map( $model->_post->tags, 'id', 'name' ) ) ); $js = <<"+value+""); }); $('#posttagform-new_tags').trigger('change'); JS; $this->registerJs( $js, $this::POS_READY ); } ?>
['enctype'=>'multipart/form-data'] ]); ?>
field($model, 'category_id')->dropDownList($model->categoriesList($model->type_id), ['prompt' => '']) ?> field($model, 'published_at')->widget(\kartik\widgets\DateTimePicker::classname(), [ 'options' => [], 'pluginOptions' => [ 'autoclose' => true, 'format' => 'dd.mm.yyyy hh:ii:ss', ] ]); ?>
field($model->tags, 'new_tags')->widget(\kartik\widgets\Select2::classname(), [ 'options' => [ 'placeholder' => Yii::t('post','Set tags...'), 'multiple' => true, ], 'pluginOptions' => [ 'tags' => true, 'tokenSeparators' => [',', ' '], 'maximumInputLength' => 12, 'ajax' => [ 'url' => $fetchUrl, 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term, type_id:' . $model->type_id . '}; }') ], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(tag) { return tag.text; }'), 'templateSelection' => new JsExpression('function (tag) { return tag.text; }'), ], ])->label(false); ?>
field($model, 'image')->label(false)->widget(FileInput::class, [ 'options' => [ 'accept' => 'image/*', ], 'pluginOptions' => [ 'showUpload' => false, ], ]) ?> _post) && $model->_post->image): ?> _post->getThumbFileUrl('image', 'thumb_gallery_view'), [ 'class' => 'thumbnail', 'width' => 300, ]) ?> field($model, 'reset_image')->checkbox() ?>
field($model, 'video')->textInput()->label(Yii::t('post', 'YouTube URL'))->hint(Yii::t('post', 'If a video link is specified, the image will be used as a preview image')) ?>
field($model, 'title')->textInput(['maxlength' => true]) ?> field($model, 'slug')->textInput(['maxlength' => true]) ?> field($model, 'description')->textarea(['rows' => 5]) ?>
field($model->meta, 'title')->textInput() ?> field($model->meta, 'description')->textarea(['rows' => 2]) ?> field($model->meta, 'keywords')->textInput() ?>
'btn btn-success']) ?>