PHP
1// HogesController.php 2 public function signup() { 3 if ($this->request->is('post')){ 4 5 // 本登録用URLを作成 6 $url = 'activate/' . $this->Hoges->id . '/' . $this->Hoges->getActivationHash(); 7 $url = Router::url($url, true); 8 //-------------------------------------------------------------- 9 10 $this->Session->setFlash( '仮登録成功。メール送信しました。'); 11 12 } else { 13 $this->Flash->error(__('The coordinator could not be saved. Please, try again.')); 14 } 15 //-------------------------------------------------------------- 16 } 17 }
PHP
1// Model/Entity/Hoge.php 2public function getActivationHash() { 3 // ユーザIDの有無確認 4 if (!isset($this->id)) { 5 return false; 6 } 7 // 更新日時をハッシュ化 8 return Security::hash( $this->field('modified'), 'md5', true); 9 }
######エラーメッセージ
Table "App\Model\Table\HogesTable" is not associated with "id"
######参考URL
http://kwski.net/cakephp-2-x/1100/
######説明
PHP
1if (!isset($this->id)) { 2 return false; 3 }
ここが問題だと考えています。
記述方法のミスでしょうか?
よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/06 12:18 編集
2017/02/06 12:32 編集
2017/02/06 12:50
2017/02/06 13:16
2017/02/06 13:30