<?= $this->extend($viewDatas['layout']['layout']) ?>
<?= $this->section('content') ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
<div id="container" class="content">
  <div class="form_top"><?= $this->include("{$viewDatas['layout']['template']}/form_content_top"); ?></div>
  <table class="table table-bordered">
    <tr>
      <th class="bg-light" colspan="2"><?= $viewDatas['title'] ?></th>
    </tr>
    <?php foreach ($viewDatas['formFields'] as $field => $label): ?>
      <tr>
        <th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
        <td nowrap class="text-start"><?= $viewDatas['helper']->getFieldView($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?></td>
      </tr>
    <?php endforeach; ?>
  </table>
  <?php if (session('message')): ?><div class="alert alert-danger text-start"><?= nl2br(session('message')) ?></div><?php endif; ?>
  <div class="form_bottom"><?= $this->include("{$viewDatas['layout']['template']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>