guild/backend/modules/document/views/template/_form.php
2022-01-14 15:39:09 +03:00

42 lines
1.1 KiB
PHP

<?php
use common\helpers\TemplateDocumentTypeHelper;
use kartik\file\FileInput;
use mihaildev\elfinder\InputFile;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\document\models\Template */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="template-form">
<?php $form = ActiveForm::begin([
'options' => ['enctype'=>'multipart/form-data']]); ?>
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'document_type')->dropDownList(
TemplateDocumentTypeHelper::getDocumentTypeList(),
[
'prompt' => 'Выберите'
]
) ?>
<?= $form->field($model, 'template')->widget(FileInput::classname(), [
'options' => ['accept' => 'text/*'],
'pluginOptions' => [
'allowedFileExtensions'=>['docx'],'showUpload' => true
],
]); ?>
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>