PHP
1$this->loadComponent('Auth', [ 2 'authenticate' => [ 3 'Form' => [ 4 'userModel' => 'users', 5 'fields' => [ 6 'username' => 'id', 7 'password' => 'password', 8 'contain' => ['offices'], 9 ], 10 'scope' => [ 11 'status' => 1, 12 ], 13 ] 14 ], 15 ]);
'contain' => 'offices',
参考サイトを参考にログイン時にアソシエーションできるかなと試したのですが、できませんでした。
$this->Auth->user()
でログインユーザの情報を取得する時にアソシエーション先の情報も取得したいのですが
どうしたらいいでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/28 12:34