guild/backend/modules/document/views/document-field-value/_form.php

47 lines
1.4 KiB
PHP
Raw Normal View History

2021-12-27 16:50:17 +03:00
<?php
use backend\modules\document\models\Document;
use common\models\DocumentField;
use kartik\select2\Select2;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\document\models\DocumentFieldValue */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="document-field-value-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'document_id')->widget(Select2::className(),
[
'data' => Document::find()->select(['title', 'id'])
->indexBy('id')->column(),
'options' => ['placeholder' => 'Выберите документ','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true
],
]) ?>
<?= $form->field($model, 'field_id')->widget(Select2::className(),
[
'data' => DocumentField::find()->select(['title', 'id'])
->indexBy('id')->column(),
'options' => ['placeholder' => 'Выберите поле','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true
],
]) ?>
<?= $form->field($model, 'value')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>