<?php

$form = new \itguild\forms\ActiveForm();
$form->beginForm("/admin/settings/tag/update");

//\kernel\helpers\Debug::dd($value);
?>

<div class="row">
    <h5>Выберите сущности, к которым хотите прикрепить теги</h5>
</div>

<?php
$form->field(\itguild\forms\inputs\Select::class, "entity[]", [
    'class' => "form-control",
    'value' => \kernel\EntityRelation::getEntityByProperty('tag') ?? '',
    'multiple' => "multiple",

])
    ->setLabel("Сущности")
    ->setOptions(\kernel\EntityRelation::getEntityList())
    ->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();
