cakePHPにてサンプルで見つけたsignupの関数でFlashメソッド使用時のコードでマジックメソッドを使用していますが、理由がわかりません。
マジックメソッド使用しているときとしていないときの違いを教えていただきたいです。
public function signup() { $user = $this->Users->newEntity(); if($this->request->is('post')){ $user = $this->Users->patchEntity($user,$this->request->data); if($this->Users->save($user)){ //successのあとの__はなんのため。。。 下記のerror部分も同様 $this->Flash->success(__('you signed up! now please login')); return $this->redirect(['action'=>'signup']); } $this->Flash->error(__('you couldnt singed up')); } $this->set('user',$user); }

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/29 13:19