Note that there are some explanatory texts on larger screens.

plurals
  1. POCakePHP form helper - HABTM multiple checkbox styling
    primarykey
    data
    text
    <p>I have two tables: "restaurants" and "cuisines" which are related to each other by a HABTM table</p> <p>The table cuisines has certain fixed entries - 54 number</p> <p>A restaurant can have any number of cuisines. On baking the application this came with a multiple select. Since i wanted check boxes i used array( 'type' => 'select', 'multiple' => 'checkbox') to convert it into checkboxes.</p> <p>Now i want to style the way this checkboxes are displayed into columns of 4 as seen on the screenshot below.</p> <p>img2.pict. com/82/bc/a4/1453459/0/200908111511.png</p> <pre><code>echo $form-&gt;input('Cuisine', array('type' =&gt; 'select', 'multiple' =&gt; 'checkbox')); </code></pre> <p>The above code produces many div's around each element as follows</p> <p><a href="http://img2.pict.com/1a/a3/0a/1453457/0/200908121509.png" rel="nofollow noreferrer">http://img2.pict.com/1a/a3/0a/1453457/0/200908121509.png</a></p> <p>I have tried the following: </p> <pre><code>echo $form-&gt;input('Cuisine', array( 'type' =&gt; 'select', 'multiple' =&gt; 'checkbox', 'div' =&gt; false, 'label' =&gt; false)); </code></pre> <p>but this code only removes the outside divs and label. I am not able to control the internal</p> <pre><code>&lt;div class="checkbox"&gt; &lt;label for="CuisineCuisine2"&gt;Andhra&lt;/label&gt; </code></pre> <p>that appear around the single checkboxes.</p> <p>How can I use the FormHelper to remove or give classes to the internal divs, so I can do some custom styling? Or is there any other way to populate this HABTM table to get the effect i want?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload