guild/backend/modules/document/views/template/_form.php

42 lines
1.1 KiB
PHP
Raw Normal View History

2021-12-27 16:50:17 +03:00
<?php
use common\helpers\TemplateDocumentTypeHelper;
2022-01-10 15:22:51 +03:00
use kartik\file\FileInput;
2022-01-05 17:11:31 +03:00
use mihaildev\elfinder\InputFile;
2021-12-27 16:50:17 +03:00
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">
2022-01-05 17:11:31 +03:00
<?php $form = ActiveForm::begin([
'options' => ['enctype'=>'multipart/form-data']]); ?>
2021-12-27 16:50:17 +03:00
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'document_type')->dropDownList(
TemplateDocumentTypeHelper::getDocumentTypeList(),
[
'prompt' => 'Выберите'
]
) ?>
2022-01-10 15:22:51 +03:00
<?= $form->field($model, 'template')->widget(FileInput::classname(), [
'options' => ['accept' => 'text/*'],
'pluginOptions' => [
'allowedFileExtensions'=>['docx'],'showUpload' => true
],
]); ?>
2022-01-05 17:11:31 +03:00
2021-12-27 16:50:17 +03:00
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>