###前提・実現したいこと
cakePHP3にて、
・app/config/parameters.phpに配列を用意
・登録フォームを用意(Controllerとは別のテーブルでアソシエーションしてる)
・constの配列をselectフィールドのlistとして設定したい。
対象Column
テーブル名:[member_detail]
Column名:[country]
###表示されるエラー
Error: The application is trying to load a file from the parameters plugin.
###該当のソースコード
MemberController
Configure::load("parameters.php"); $this->set('Countrys', Configure::read('Countrys.ja')); $member = $this->Member->newEntity($this->request->data, [ 'associated' => ['MemberDetail'] ]);
parameters.php
'Countrys' => [ 'ja' => [ 1 => '日本', 2 => 'アメリカ合衆国', ], ],
register.ctp
echo $this->Form->select('member_detail.0.country_id');
###補足情報(言語/FW/ツール等のバージョンなど)
php7.1.1 / cake PHP3.3.12/
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/07 07:36
2017/02/07 07:50