0
votes

I'm trying to add custom tag to cakephp form input but it won't apply. I am using Bootstrap switch My code :

$this->Form->input('item_id', array(
       'multiple' => 'checkbox',
       'div' => false,
       'data-label-text' => $items, 
       'class' => 'form-control',
   ));

att: i want to add item names as a 'data-label-text'

this is working (with out other attributes)

$this->Form->checkbox('aaa', array('data-label-text'=>'new item out'));

Any idea ? help ?

1

1 Answers

0
votes

Try this

$options = array(0 => 'new item out 1', 1 => 'new item out 2');
echo $this->Form->input('item_id', array(
   'multiple' => 'checkbox',
   'div' => false,
   'options' => $options, 
   'class' => 'form-control',
  ));