firstPHP/views/admin/index.php

76 lines
2.1 KiB
PHP
Raw Normal View History

2024-04-15 17:46:33 +03:00
<?php
/**
2024-05-02 17:52:03 +03:00
* @var \itguild\forms\ActiveForm $form
* @var \itguild\forms\app\DTO\FormDTO $dto
2024-04-15 17:46:33 +03:00
*/
use itguild\forms\inputs\TextInput;
use itguild\forms\inputs\TextArea;
2024-04-17 17:30:00 +03:00
2024-04-15 17:46:33 +03:00
?>
<?php echo $form->beginForm("/admin/save-form"); ?>
<?php $form->field(TextInput::class, name: "title", params: [
'class' => "form-control",
2024-05-02 17:52:03 +03:00
'placeholder' => 'Название формы',
'value' => $dto->get('title'),
2024-04-15 17:46:33 +03:00
])
->setLabel("Название формы")
->render();
2024-04-16 17:13:42 +03:00
2024-04-17 17:30:00 +03:00
$form->field(TextInput::class, name: "perPage", params: [
2024-04-16 17:54:37 +03:00
'class' => "form-control",
2024-05-02 17:52:03 +03:00
'placeholder' => 'Perpage',
'value' => $dto->get('perPage'),
2024-04-16 17:54:37 +03:00
])
->setLabel("Количество выводимых записей на страницу")
->render();
2024-04-22 11:31:44 +03:00
2024-05-02 17:52:03 +03:00
$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();
2024-04-17 17:30:00 +03:00
$form->field(\itguild\forms\inputs\Select::class, name: "inputType", params: [
'class' => "form-control-sm",
'id' => "selectID",
'placeholder' => 'Параметры',
2024-05-02 17:52:03 +03:00
'options' => \itguild\forms\app\services\InputTypeService::getInputTypes()
2024-04-17 17:30:00 +03:00
])
->setLabel("Добавить поле")
->render();
2024-04-16 17:13:42 +03:00
?>
2024-05-02 17:52:03 +03:00
<button style="margin-top:15px" type="button" id="buttonAdd" class="btn btn-success " onclick="getValueSelect()"
data-count=0>Добавить поле
</button>
2024-04-16 17:13:42 +03:00
<?php
2024-04-15 17:46:33 +03:00
$form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
'class' => "btn btn-primary ",
'value' => 'Отправить',
'typeInput' => 'submit'
])
->render();
2024-04-16 17:13:42 +03:00
$form->endForm();
2024-04-15 17:46:33 +03:00
?>