cakephp チェックボックス
なんとか実装できたけど。。。
とりあえずメモ。
本来であれば、テーブルをlistで取得したかったけど、なかなか思いどおりにいかず、
力技でやることにした。。。w
また、時間があるときに修正します。
>>index.ctp
<?php
echo $this->Form->create('Post', array(
'url' => array_merge(array('action' => 'find'), $this->params['pass'])
));
$options=array('1'=>'西区','2'=>'北区','3'=>'中央区','4' => '浪速区');
$selected=array('1','4');
echo $this->Form->input('category_id',
array(
'options' => $options,
'div' => 'checkbox',
'multiple' =>'checkbox',
'type'=> 'select',
));
echo $this->Form->submit(__('Search', true), array('div' => false));
echo $this->Form->end();
?>
これ気合いでなんとかなる。
カテゴリーが増えると、またファイル修正するの面倒くさいな〜〜