<?php
    declare(strict_types=1);

    namespace Icing\View\Widget;

    use Cake\View\Form\ContextInterface;

    class SelectBoxWidget extends \BootstrapUI\View\Widget\SelectBoxWidget
    {

        public function render(array $data, ContextInterface $context): string
        {

            if (!isset($data['data-select'])) {
                $data['data-select'] = '';
            } elseif ($data['data-select'] === false) {
                unset($data['data-select']);
            } elseif (is_array($data['data-select'])) {
                $data['data-select'] = json_encode($data['data-select']);
            }

            return parent::render($data, $context);
        }


    }
