cakephp checkbox default

cakephp version 2.3.4で確認

 

$options = array( 0 => '00000', 1 => '11111', 2 => '22222');

$default = array(0, 2); // $optionsのkeyを指定

 

echo $this->Form->input('sample', array(

    'multiple' => 'checkbox',

    'options' => $options,

    'default' => $default

));