Search code examples
cakephpctp

How to enter an id in a select multiple cakephp


I want to put an id to my select but I don't know how to do it.

echo $this->form->select("alergias2", ["Alergias"=>$alergias],["multiple"=>true]);

I have tried it as follows.

echo $this->form->select("alergias2", array('id'=> 'alergia'), ["Alergias"=>$alergias],["multiple"=>true]);

Solution

  • I solved it like this.

     echo $this->form->select("alergias2", ["Alergias"=>$alergias],["multiple"=>true , "id"=>"alergia"]);