public function run() { $blockId = 'block_' . $this->id; $this->view->beginBlock($blockId); $inputFile = InputFile::begin(ArrayHelper::merge(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value], $this->fileInputOptions)); $inputId = $inputFile->options['id']; $previewId = 'media-' . $inputId; InputFile::end(); $this->view->endBlock(); $replace['{input}'] = $this->view->blocks[$blockId]; $replace['{img}'] = Html::tag('div', '', ['class' => 'form-media-preview', 'id' => $previewId]); echo strtr($this->template, $replace); $this->view->registerJs(<<<JS \$('#{$inputId}').change(function() { var src = \$(this).val(); if (src != '') { var img = \$('<img/>').attr('src', src); \$('#{$previewId}').wrapInner(img); } else { \$('#{$previewId}').empty(); } }).change(); JS ); }
public function init() { parent::init(); if (empty($this->suffix)) { $this->suffix = Yii::$app->params['frontend-url']; } if (empty($this->previewButtonOptions['id'])) { $this->previewButtonOptions['id'] = $this->options['id'] . '_preview'; } $this->previewButtonOptions['type'] = 'button'; $this->previewButtonOptions['data-toggle'] = 'modal'; $this->previewButtonOptions['role'] = 'button'; if (!isset($this->options['class'])) { $this->options['class'] = 'form-control'; } }
public function run() { $data = $this->model[$this->attribute]; //определяем картинку в зависимости от типа входных данных стринг/массив $imgSrc = ''; $coords = 'null'; if (is_array($data)) { if (array_key_exists('imgSrc', $data)) { $imgSrc = $data['imgSrc']; } if (array_key_exists('x1', $data) && $data['x1'] != '' && array_key_exists('y1', $data) && $data['y1'] != '' && array_key_exists('x2', $data) && $data['x2'] != '' && array_key_exists('y2', $data) && $data['y2'] != '') { $x1 = $data['x1']; $y1 = $data['y1']; $x2 = $data['x2']; $y2 = $data['y2']; $coords = '{"x1":' . $x1 . ',"y1":' . $y1 . ',"x2":' . $x2 . ',"y2":' . $y2 . '}'; } } elseif (!empty($data)) { $imgSrc = $data; } //рендерим блок с картинкой $previewId = $this->id . '_preview_img'; $previewImgClass = 'form-img-preview-crop-image'; $inputId = BaseHtml::getInputId($this->model, $this->attribute); if (empty($imgSrc)) { $preview = "<div id='{$previewId}'></div>"; } else { $preview = Html::tag('div', Html::img($imgSrc, ['class' => $previewImgClass . ' crop-image', 'data-forinput' => $inputId, 'data-coords' => $coords]), ['id' => $previewId]); } $this->template = strtr($this->template, ['{preview}' => $preview]); //рендерим инпуты $inputs = Html::activeTextInput($this->model, $this->attribute . '[imgSrc]', $this->options); $inputs .= Html::activeTextInput($this->model, $this->attribute . '[x1]', ['type' => 'hidden']); $inputs .= Html::activeTextInput($this->model, $this->attribute . '[y1]', ['type' => 'hidden']); $inputs .= Html::activeTextInput($this->model, $this->attribute . '[x2]', ['type' => 'hidden']); $inputs .= Html::activeTextInput($this->model, $this->attribute . '[y2]', ['type' => 'hidden']); $this->template = strtr($this->template, ['{inputs}' => $inputs]); parent::run(); //css и js $view = $this->getView(); //подключаем ресурсы CropImageAsset::register($view); //стили для отображения картинки $view->registerCss(".{$previewImgClass} {max-width:{$this->imgMaxWidth}; max-height:{$this->imgMaxHeight}}"); //подключаем файловый менеджер сервера $view->registerJs("mihaildev.elFinder.register(" . Json::encode($this->options['id']) . ",\n function(file, id){\n UnInitImageAreaSelect('{$inputId}');\n \$('#' + id).val(file.url);\n \$('#{$previewId}').html('<img class=\"{$previewImgClass} crop-image\" src=\"'+file.url+'\" data-forinput=\"{$inputId}\" >');\n \$('#{$previewId} .{$previewImgClass}').load(function(){ InitImageAreaSelect() });\n return true;}); "); }
public function run() { if ($this->hasModel()) { $src = \yii\helpers\Html::getAttributeValue($this->model, $this->attribute); } else { $src = $this->value; } $previewId = $this->id . '_preview_img'; if (empty($src)) { $preview = '<div id="' . $previewId . '"></div>'; } else { $preview = Html::tag('div', Html::img($src, ['class' => 'form-img-preview']), ['id' => $previewId]); } $replace['{preview}'] = $preview; $this->template = strtr($this->template, $replace); parent::run(); $this->getView()->registerJs("mihaildev.elFinder.register(" . Json::encode($this->options['id']) . ", function(file, id){ \$('#' + id).val(file.url); \$('#{$previewId}').html('<img class=\"form-img-preview\" src=\"'+file.url+'\">'); return true;}); "); $this->view->registerCss('.form-img-preview {max-width:100px;}'); }
<?php use mihaildev\elfinder\InputFile; /** * @var $form \yii\widgets\ActiveForm * @var $block \nullref\cms\blocks\text\Block */ echo $form->field($block, 'image')->widget(InputFile::className(), ['language' => 'ru', 'controller' => 'elfinder-backend', 'filter' => 'image', 'template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default'], 'multiple' => false]); echo $form->field($block, 'alt')->textInput(); echo $form->field($block, 'width')->textInput(); echo $form->field($block, 'height')->textInput();
?> <?php echo $form->field($model, 'subtitle')->textInput(); ?> <?php echo $form->field($model, 'parent_id')->dropDownList($app->catlist, ['prompt' => Yii::t('backend', 'Корневая категория')]); ?> <?php echo $form->field($model, 'image')->widget(\mihaildev\elfinder\InputFile::className(), ['language' => 'ru', 'controller' => 'elfinder', 'template' => '<div class="uk-form-row">{input}{button}</div>', 'options' => ['class' => 'uk-from-controls'], 'buttonOptions' => ['class' => 'uk-button uk-button-primary'], 'multiple' => false]); ?> <?php echo $form->field($model, 'preview')->widget(\mihaildev\elfinder\InputFile::className(), ['language' => 'ru', 'controller' => 'elfinder', 'template' => '<div class="uk-form-row">{input}{button}</div>', 'options' => ['class' => 'uk-from-controls'], 'buttonOptions' => ['class' => 'uk-button uk-button-primary'], 'multiple' => false]); ?> <?php echo $form->field($model, 'state')->checkbox(); ?> <hr> <?php echo $form->field($model, 'intro')->widget(\mihaildev\ckeditor\CKEditor::className(), ['editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions(['elfinder', 'path' => '/'], ['preset' => 'standart', 'allowedContent' => true, 'height' => '200px', 'toolbar' => Yii::$app->zoo->cke_editor_toolbar, 'contentsCss' => Yii::$app->zoo->cke_editor_css])]); ?> <?php echo $form->field($model, 'content')->widget(\mihaildev\ckeditor\CKEditor::className(), ['editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions(['elfinder', 'path' => '/'], ['preset' => 'standart', 'allowedContent' => true, 'height' => '200px', 'toolbar' => Yii::$app->zoo->cke_editor_toolbar, 'contentsCss' => Yii::$app->zoo->cke_editor_css])]); ?>
if (!$model->isNewRecord) { echo Html::a('<span class="glyphicon glyphicon-trash"></span> Удалить', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger']); } ?> </div> </div> <div class="row"> <div class="col-sm-6"> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> </div> <div class="col-sm-6"> <?php echo $form->field($model, 'path')->widget(InputFile::className(), ['language' => 'ru', 'controller' => 'front-elfinder', 'template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default'], 'buttonName' => 'Выбрать файл', 'multiple' => false]); ?> </div> </div> </div> </div> <div class="box box-panel"> <div class="box-header with-border"> <h3 class="box-title"> <i class="glyphicon glyphicon-th-list"></i> Расширенные «быстрые» поля для документов: <?php for ($i = 1; $i <= Template::OPTIONS_COUNT; $i++) { $type_option = 'option_' . $i . '_type'; if ($model->{$type_option}) {
<?php echo $form->field($model, 'status')->dropDownList(Message::getStatuses()); ?> </div> </div> <div class="row"> <div class="col-sm-12"> <?php echo $form->field($model, 'content')->textarea(); ?> </div> </div> <div class="row"> <div class="col-sm-6"> <?php echo $form->field($model, 'attachment')->widget(InputFile::className(), ['language' => 'ru', 'controller' => 'elfinder', 'template' => '<div class="input-group"> {input}<span class="input-group-btn">{button}</span> </div>', 'options' => ['class' => 'form-control'], 'buttonName' => 'Выбрать файл', 'buttonOptions' => ['class' => 'btn btn-default'], 'multiple' => false]); ?> </div> <div class="col-sm-6"> <?php echo $form->field($model, 'parent_message_id')->textInput(['maxlength' => true]); ?> </div> </div> <div class="row"> <div class="col-sm-6"> <?php echo $form->field($model, 'for_user_id')->widget(Select2::classname(), ['language' => 'ru', 'data' => User::getAll(), 'options' => ['placeholder' => ''], 'pluginOptions' => ['allowClear' => true]]); ?>
?> <?php echo $form->field($model, 'parent_id')->dropDownList($treeParents, ['prompt' => '---ROOT---']); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'slug')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'image')->widget(InputFile::className(), ['language' => 'en', 'controller' => 'elfinder', 'path' => 'image', 'filter' => 'image', 'template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-success'], 'multiple' => false]); ?> <?php echo $form->field($model, 'content')->widget(CKEditor::className(), ['editorOptions' => elFinder::ckeditorOptions(['elfinder'], ['preset' => 'standard', 'entities' => false])]); ?> <?php echo $form->field($model, 'meta_title')->textInput(); ?> <?php echo $form->field($model, 'meta_keywords')->textInput(['maxlength' => true]); ?> <?php
break; case 3: // Флажок echo Html::activeCheckbox($model, $attr_value, ['class' => 'form-control', 'id' => $attr_id, 'label' => null]); break; case 5: // Текст echo Html::activeTextarea($model, $attr_value, ['class' => 'form-control', 'id' => $attr_id]); break; case 6: // Список (дочерние документы echo Select2::widget(['model' => $model, 'attribute' => $attr_value, 'data' => Document::getAll($field['param']), 'options' => ['id' => $attr_id, 'placeholder' => ''], 'pluginOptions' => ['allowClear' => true, 'class' => 'form-control', 'id' => $attr_id]]); break; case 8: // Файл (выбор с сервера) echo InputFile::widget(['controller' => 'elfinder', 'template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control', 'id' => $attr_id], 'buttonOptions' => ['class' => 'btn btn-default'], 'buttonName' => Yii::t('document', 'Выбрать файл'), 'multiple' => false, 'name' => 'Document[fields][' . $field_id . '][data][' . $data_id . '][value]', 'value' => isset($model->fields[$field_id]['data'][$data_id]['value']) ? $model->fields[$field_id]['data'][$data_id]['value'] : null]); break; case 7: // Дата echo DatePicker::widget(['model' => $model, 'attribute' => $attr_value, 'options' => ['id' => $attr_id, 'placeholder' => ''], 'pluginOptions' => ['format' => 'dd.mm.yyyy', 'class' => 'form-control', 'id' => $attr_id]]); break; } } ?> </div> <div class="help-block"> <?php echo $attr_error; ?> </div> </div>
case 11: // Регулярное выражение echo "<div class='{$class}'><div>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . "</div><div>" . Html::activeInput('text', $model, $option, $options_attributes) . "</div><div class='help-block'>" . $error . "</div></div>"; break; case 4: // Выключатель echo "<div class='{$class}'><div>" . Html::activeLabel($model, $option, ['class' => 'control-label', 'id' => 'document-option_' . $i]) . "</div><div>" . Html::activeCheckbox($model, 'option_' . $i, ['label' => null]) . "</div><div class='help-block'>" . $error . "</div></div>"; break; case 5: // Текст echo "<div class='{$class}'><div>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . "</div><div>" . Html::activeTextarea($model, $option, $options_attributes) . "</div><div class='help-block'>" . $error . "</div></div>"; break; case 6: // Файл (выбор) echo "<div class='{$class}'><div>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . "</div><div>" . InputFile::widget(['language' => 'ru', 'controller' => 'elfinder', 'filter' => 'image', 'template' => '<div class="input-group"> {input}<span class="input-group-btn">{button}</span> </div>', 'options' => $options_attributes, 'buttonOptions' => ['class' => 'btn btn-default'], 'buttonName' => 'Выбрать файл', 'name' => 'Document[option_' . $i . ']', 'value' => $model->{$option}]) . "</div><div class='help-block'>" . $error . "</div></div>"; break; case 7: // Изображение (загрузка) echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . FileInput::widget(['model' => $model, 'attribute' => $option_file, 'pluginOptions' => ['browseClass' => 'btn btn-default', 'browseLabel' => 'Загрузить файл', 'removeLabel' => 'Удалить', 'removeClass' => 'btn btn-default', 'browseIcon' => '', 'removeIcon' => '', 'showUpload' => false]]) . Html::activeHiddenInput($model, $option_file, $options_attributes); if (!$model->isNewRecord && $model->{$option} && $model->last_template_id == $model->template_id) { echo Html::img($model->{$option}, ['class' => 'doc_img img-thumbnail']) . "<p>" . Html::a('Удалить изображение', ['/document/deleteimg', 'document_id' => $model->id, 'option_id' => $i], ['class' => 'lnk delete_photo']) . "</p>"; } echo "<div class='help-block'>" . $error . "</div></div>"; break; case 8: // Список дочерних документов echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . Select2::widget(['model' => $model, 'attribute' => $option, 'data' => Document::getChilds($template->{$option_param}, true), 'options' => ['placeholder' => ''], 'pluginOptions' => $options_attributes]) . "<div class='help-block'>" . $error . "</div></div>"; break; case 9:
<?php echo $form->field($model, 'title')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'subtitle')->textInput(['maxlength' => 255]); ?> <div class="uk-form-row"> <?php echo Html::activeLabel($model, 'image', ['class' => 'uk-form-label']); ?> <div class="uk-from-controls"> <?php echo \mihaildev\elfinder\InputFile::widget(['language' => 'ru', 'controller' => 'elfinder', 'model' => $model, 'attribute' => 'image', 'buttonName' => 'Выбрать', 'buttonOptions' => ['class' => 'uk-button uk-button-primary']]); ?> <div class="uk-form-help-block uk-text-danger"></div> </div> </div> <div class="uk-form-row"> <?php echo Html::activeLabel($model, 'content', ['class' => 'uk-form-label']); ?> <div class="uk-form-controls"> <?php echo \mihaildev\ckeditor\CKEditor::widget(['model' => $model, 'attribute' => 'content', 'editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions(['elfinder', 'path' => '/'], ['preset' => 'standart', 'allowedContent' => true, 'height' => '200px', 'toolbar' => Yii::$app->zoo->cke_editor_toolbar, 'contentsCss' => Yii::$app->zoo->cke_editor_css])]); ?> </div> </div>
$fields[] = $form->field($model, 'status')->checkbox(); $fieldGroups[] = ['label' => 'User Info', 'content' => implode('', $fields)]; $fields = []; $customerInfo = $model->customerInfo ?: \kiwi\Kiwi::getCustomerInfo(); $fields[] = $form->field($customerInfo, 'nick_name')->textInput(['maxlength' => 255]); $fields[] = $form->field($customerInfo, 'real_name')->textInput(['maxlength' => 255]); $fields[] = $form->field($customerInfo, 'avatars')->textInput(['maxlength' => 255]); $fields[] = $form->field($customerInfo, 'phone')->textInput(['maxlength' => 255]); $fields[] = $form->field($customerInfo, 'qq')->textInput(['maxlength' => 255]); $fields[] = $form->field($customerInfo, 'address')->textInput(['maxlength' => 255]); $fields[] = $form->field($customerInfo, 'sex')->textInput(); $fields[] = $form->field($customerInfo, 'age')->textInput(); // $fields[] = $form->field($customerInfo, 'payment_password')->textInput(['maxlength' => 255]); $fields[] = $form->field($customerInfo, 'id_card_no')->textInput(['maxlength' => 255]); $fields[] = $form->field($customerInfo, 'id_card_front_pic')->widget(InputFile::className(), ['template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default']]); $fields[] = $form->field($customerInfo, 'id_card_back_pic')->widget(InputFile::className(), ['template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default']]); $fieldGroups[] = ['label' => 'Customer Info', 'content' => implode('', $fields)]; $fields = []; $groups = \kiwi\Kiwi::getGroup()->find()->all(); $groups = ArrayHelper::map($groups, 'id', 'name'); $fields[] = $form->field($model, 'groups')->widget(Select2::classname(), ['data' => $groups, 'language' => 'en', 'options' => ['placeholder' => 'Select a state ...'], 'options' => []]); $fieldGroups[] = ['label' => 'Customer Group', 'content' => implode('', $fields)]; echo Tabs::widget(['items' => $fieldGroups]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>
public function run() { return $this->form->field($this->model, $this->attribute)->widget(InputFile::className(), $this->fileManager); }
?> </h1> <div class="row"> <div class="co-xs-12 col-md-7 col-lg-5"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'modelClass')->widget(DependDropDown::className(), ["dependAttr" => "key", "source" => ["/import/admin/csv-import/keys"], "data" => $classes, "serverAttr" => "cls", "triggerChange" => true, "options" => ["class" => "form-control"]]); ?> <?php echo $form->field($model, 'filePath')->widget(\mihaildev\elfinder\InputFile::className(), ["template" => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', "options" => ["class" => "form-control"], "buttonOptions" => ["class" => "btn btn-default"]]); ?> <?php echo $form->field($model, 'headLine')->checkbox(); ?> <?php echo $form->field($model, 'key')->widget(DependDropDown::className(), ["options" => ["class" => "form-control"]]); ?> <?php echo $form->field($model, 'delimiter'); ?> <?php
$fields[] = $form->field($model, 'meta_keywords')->textInput(['maxlength' => 255]); $fields[] = $form->field($model, 'sort')->textInput(); $fields[] = $form->field($model, 'status')->checkbox(); $fieldGroups[] = ['label' => 'Base Info', 'content' => implode('', $fields)]; $fields = []; $fields[] = $form->field($model, 'original_price')->textInput(['maxlength' => 10]); $fields[] = $form->field($model, 'price')->textInput(['maxlength' => 10]); $fields[] = $form->field($model, 'stock_qty')->textInput(); $fields[] = $form->field($model, 'min_sale_qty')->textInput(); $fields[] = $form->field($model, 'max_sale_qty')->textInput(); $fields[] = $form->field($model, 'weight')->textInput(['maxlength' => 10]); $fields[] = $form->field($model, 'shipping_fee')->textInput(['maxlength' => 10]); $fields[] = $form->field($model, 'is_free_shipping')->checkbox(); $fieldGroups[] = ['label' => 'Price & Stock', 'content' => implode('', $fields)]; $fields = []; $fields[] = $form->field($model, 'pictures')->widget(InputFile::className(), ['multiple' => true, 'template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default']]); $categories = \kiwi\Kiwi::getCategory()->find()->all(); $categories = ArrayHelper::map($categories, 'id', 'name'); $fields[] = $form->field($model, 'categoryIds')->widget(Select2::classname(), ['data' => $categories, 'language' => 'en', 'options' => ['placeholder' => 'Select a state ...'], 'options' => ['multiple' => true]]); $tags = \kiwi\Kiwi::getTag()->find()->all(); $tags = ArrayHelper::map($tags, 'id', 'name'); $fields[] = $form->field($model, 'tagIds')->widget(Select2::classname(), ['data' => $tags, 'language' => 'en', 'options' => ['placeholder' => 'Select a state ...'], 'options' => ['multiple' => true]]); $fieldGroups[] = ['label' => 'Picture & Category & Tag', 'content' => implode('', $fields)]; echo Tabs::widget(['items' => $fieldGroups]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>
<?php echo $form->field($linkParamsModel, 'rel')->textInput(); ?> </div> <div id="meta-options" class="tab-pane"> <?php echo $form->field($model, 'metakey')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'metadesc')->textarea(['maxlength' => 2048]); ?> <?php echo $form->field($model, 'metaimg')->widget(\mihaildev\elfinder\InputFile::className(), ['language' => Yii::$app->language, 'controller' => 'media/manager', 'filter' => 'image', 'template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default'], 'multiple' => false]); ?> <?php echo $form->field($model, 'robots')->dropDownList(['index, follow' => 'Index, Follow', 'noindex, follow' => 'No index, follow', 'index, nofollow' => 'Index, No follow', 'noindex, nofollow' => 'No index, no follow'], ['prompt' => 'Не выбрано']); ?> </div> </div> <?php echo Html::activeHiddenInput($model, 'lock'); ?> <div> <?php echo Html::submitButton($model->isNewRecord ? '<i class="glyphicon glyphicon-plus"></i> ' . Yii::t('gromver.platform', 'Create') : '<i class="glyphicon glyphicon-pencil"></i> ' . Yii::t('gromver.platform', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?> </div> </div> <div class="row"> <div class="col-lg-12"> <?php echo $form->field($model, 'content')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions('elfinder', [])]); ?> </div> </div> <div class="row"> <div class="col-lg-6"> <?php echo $form->field($model, 'image')->widget(InputFile::className(), ['controller' => 'elfinder', 'filter' => 'image', 'template' => '<div class="input-group"> {input}<span class="input-group-btn">{button}</span> </div>', 'options' => ['class' => 'form-control'], 'buttonName' => Yii::t('document', 'Выбрать файл'), 'buttonOptions' => ['class' => 'btn btn-default'], 'multiple' => false]); ?> </div> <div class="col-lg-6"> <?php echo $form->field($model, 'position')->textInput(['maxlength' => true]); ?> </div> </div> <div id = "lb-document-module-fields"> <?php echo $this->render('_fields', ['model' => $model]); ?>
<?php foreach ($model->image as $key => $image) { ?> <div class="uk-from-controls"> <?php echo InputFile::widget(['language' => 'ru', 'controller' => 'elfinder', 'model' => $model, 'attribute' => "image[{$key}]", 'buttonName' => 'Выбрать', 'options' => ['class' => 'uk-form-width-large'], 'buttonOptions' => ['class' => 'uk-button uk-button-primary']]); ?> </div> <?php } ?> <div class="uk-from-controls"> <?php echo InputFile::widget(['language' => 'ru', 'controller' => 'elfinder', 'model' => $model, 'attribute' => "image[]", 'buttonName' => 'Выбрать', 'options' => ['class' => 'uk-form-width-large'], 'buttonOptions' => ['class' => 'uk-button uk-button-primary']]); ?> </div> </div> <?php } elseif ($model->type == 3) { ?> <?php } ?> <?php echo Html::a('Добавить строку', $url = null, ['data' => ['method' => 'post', 'params' => ['reload' => true], 'pjax' => true]]);