0
早上好,我試圖只在用戶從其他控制器重定向時才允許訪問控制器。CakePHP 3:僅當從特定動作重定向時才允許訪問
if ($this->referer() !=
Router::url(array(
'controller'=>'customers', 'action'=>'register'
))) {
return $this->redirect(['controller'=>'customers','action'=>'register']);
}
但上面的代碼總是將我重定向到customers/register。
我在CakePHP文檔中找不到任何東西,所以如果有人有我的想法?
好的。這很有幫助。非常感謝 – Dirk