Skillbooker
Login Register

Cakephp


cakephp: How to set default value in select dropdown list

$this->Form->input('Country.id', array('type'=>'select', 'label'=>'Countries', 'options'=>$countrylist, 'default'=>'3'));
The default value can be a variable that can be 'set' in the controller and passed to the view..

Posted on: 2016-06-01 Please login/register to leave comments