<?php
$label = trim((string)($this->label ?? 'Kategorie'));
$inputName = trim((string)($this->inputName ?? 'categories[]'));
$categories = is_array($this->categories ?? null) ? $this->categories : [];
$selectedIds = is_array($this->selectedIds ?? null) ? $this->selectedIds : [];
?>
<div class="form-group row js-coupon-row js-coupon-row-categories">
  <label class="col-lg-4 control-label"><?= htmlspecialchars($label, ENT_QUOTES, 'UTF-8'); ?>:</label>
  <div class="col-lg-8">
    <div class="coupon-categories-box">
      <?= \Shared\Tpl\Tpl::view('shop-coupon/coupon-categories-tree', [
        'categories' => $categories,
        'selectedIds' => $selectedIds,
        'inputName' => $inputName,
      ]); ?>
    </div>
  </div>
</div>

