9 июля 2018 г.

Controlling CakePHP FriendsOfCake/bootstrap-ui checkbox/radio wrappers

CakePHP may render the inputs based on your global $this->Form preferences. This will be a problem if you just need a clean checkbox to place in a table, and have the whole row be it's label for example.

To solve, you will need to use templates. Add the following to your form options:

    'templates' => [
        'checkboxContainer' => '{{content}}',
        'checkboxFormGroup' => '{{label}}{{error}}{{help}}',
        'checkboxWrapper' => '{{label}}',
Use debug($this->Form->getTemplates()); to get a list of all available templates.

Комментариев нет: