first
This commit is contained in:
71
kernel/app_modules/event/views/eventcontact/form.php
Normal file
71
kernel/app_modules/event/views/eventcontact/form.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* @var EventContact $model
|
||||
*/
|
||||
|
||||
use kernel\app_modules\event\models\EventContact;
|
||||
|
||||
$form = new \itguild\forms\ActiveForm();
|
||||
$form->beginForm(isset($model) ? "/admin/event-contacts/edit/" . $model->id : "/admin/event-contacts", 'multipart/form-data');
|
||||
|
||||
// Пример формы:
|
||||
|
||||
|
||||
$form->field(\itguild\forms\inputs\TextInput::class, 'title', [
|
||||
'class' => "form-control",
|
||||
'placeholder' => 'Контакт',
|
||||
'value' => $model->title ?? ''
|
||||
])
|
||||
->setLabel("Контакт")
|
||||
->render();
|
||||
|
||||
$form->field(class: \itguild\forms\inputs\Select::class, name: "type", params: [
|
||||
'class' => "form-control",
|
||||
'value' => $model->type ?? ''
|
||||
])
|
||||
->setLabel("Тип контакта")
|
||||
->setOptions(EventContact::getTypes())
|
||||
->render();
|
||||
|
||||
$form->field(class: \itguild\forms\inputs\Select::class, name: "event_id", params: [
|
||||
'class' => "form-control",
|
||||
'value' => $model->event_id ?? ''
|
||||
])
|
||||
->setLabel("Мероприятие")
|
||||
->setOptions(\kernel\app_modules\event\services\EventService::getList())
|
||||
->render();
|
||||
|
||||
$form->field(class: \itguild\forms\inputs\Select::class, name: "status", params: [
|
||||
'class' => "form-control",
|
||||
'value' => $model->status ?? ''
|
||||
])
|
||||
->setLabel("Статус")
|
||||
->setOptions(EventContact::getStatus())
|
||||
->render();
|
||||
|
||||
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<?php
|
||||
$form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
|
||||
'class' => "btn btn-primary ",
|
||||
'value' => 'Отправить',
|
||||
'typeInput' => 'submit'
|
||||
])
|
||||
->render();
|
||||
?>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<?php
|
||||
$form->field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [
|
||||
'class' => "btn btn-warning",
|
||||
'value' => 'Сбросить',
|
||||
'typeInput' => 'reset'
|
||||
])
|
||||
->render();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$form->endForm();
|
Reference in New Issue
Block a user