CakePHP-Bootstrap / cakephp3-bootstrap-helpers

CakePHP 3.x Helpers for Bootstrap 3 and 4.
https://holt59.github.io/cakephp3-bootstrap-helpers/
MIT License
130 stars 79 forks source link

FormHelper RuntimeException Cannot find template named 'selectedClass' #193

Open jwhoami opened 3 years ago

jwhoami commented 3 years ago

This is a (multiple allowed):

What you did

Used this code: <?= $this->Form->control('zones', ['type' => 'select', 'label' => 'Zones', 'options' => ['Zone1' => 'Zone 1', 'Zone2' => 'Zone 2'] 'default' => 1, 'multiple' => 'checkbox']);?>

What happened

Got a RuntimeException: Cannot find template named 'selectedClass'

What i did

I edited the FormHelper.php file in the vendors directory. Added the following to the templates array: 'selectedClass' => 'selected'

which fixed the problem for me. However i do not know if the fix is right. I just wanted to report this so you might look into it and apply the correct fix. Regards Jack

raul338 commented 3 years ago

refs #192

In the meantime, you can set that template in the loadHelper call

Holt59 commented 3 years ago

Sorry, I completely forgot about this. I pushed to the v4.0.3 branch and make a 4.0.3 release that should fix this.