【PHP】フレームワーク CakePHP 13ホール目【v2.0】at PHP【PHP】フレームワーク CakePHP 13ホール目【v2.0】 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト808:nobodyさん 12/03/21 23:19:44.62 ZAI6cSPi $this->set('select', $this->Foo->find('list', array(//select要素 'fields' => array( 'Foo.id', 'Foo.firstname' ))))); とすると、 $form->select("Foo.bar", array($select), 0, array('empty' => null)) で select要素の中に <option value="Fooのid">Fooのfirstnameの中身</option> というのができるんですが、 これを <option value="Fooのid">Fooのsecondnameの中身 Fooのfirstnameの中身</option> としたいんですが、find('list')は一対でしか使えないんでしょうか? やり方をご教示いただけたら幸いです 809:808 12/03/21 23:27:53.96 ZAI6cSPi 自己解決しました allで読んで、 foreach ($select as $value) { $talent_data[$value['Foo']['id']] = $value['Foo']['secondname'] . ' ' . $value['Foo']['firstname']; } $this->set('select', $select); でlistで作ったoption群と同じ形式のリストデータが生成されました 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch