beginForm("/admin/save-form/"); ?> field(TextInput::class, name: "title", params: [ 'class' => "form-control", 'placeholder' => 'Название формы', 'value' => $dto->get('title'), ]) ->setLabel("Название формы") ->render(); $form->field(TextInput::class, name: "perPage", params: [ 'class' => "form-control", 'placeholder' => 'Perpage', 'value' => $dto->get('perPage'), ]) ->setLabel("Количество выводимых записей на страницу") ->render(); $form->field(\itguild\forms\inputs\Checkbox::class, name: "actionView", params: [ 'value' => 'view', 'checked' => $dto->get('view') ]) ->setLabel("Разрешить просмотр") ->render(); $form->field(\itguild\forms\inputs\Checkbox::class, name: "actionEdit", params: [ 'value' => 'edit', 'checked' => $dto->get('edit') ]) ->setLabel("Разрешить редактирование") ->render(); $form->field(\itguild\forms\inputs\Checkbox::class, name: "actionDelete", params: [ 'value' => 'delete', 'checked' => $dto->get('delete') ]) ->setLabel("Разрешить удаление") ->render(); $form->field(\itguild\forms\inputs\Select::class, name: "inputType", params: [ 'class' => "form-control-sm", 'id' => "selectID", 'placeholder' => 'Параметры', 'options' => \itguild\forms\app\services\InputTypeService::getInputTypes() ]) ->setLabel("Добавить поле") ->render(); $form->field(\itguild\forms\inputs\Hidden::class, name: "formId", params: [ "value" => $dto->get('id') ])->render(); if (isset($fields)){ $i = 0; foreach ($fields as $field){ $viewName = \itguild\forms\app\models\InputTypeModel::getViewNameByTypeId($field['input_type_id']); $cgView->render("/admin/field_type/$viewName.php", ['form' => new ActiveForm(), 'count' => $i]); $i++; } } $form->field(\itguild\forms\inputs\Button::class, name: "", params: [ "id" => 'buttonAdd', "value" => 'Добавить поле', 'style' => "margin-top: 10px", "class" => "btn btn-success", "onclick" => "getValueSelect()", "data-count" => "0" ])->render(); $form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [ 'class' => "btn btn-primary ", 'value' => 'Отправить', 'typeInput' => 'submit' ]) ->render(); $form->endForm(); ?>