0
我有與特定的方法的控制器登錄:CakePHP3驗證的redirectUrl路線破碎
public function login() {
if ($this->request->is('post')){
$user = $this->Auth->identify();
if ($user) {
$this->Auth->setUser($user);
return $this->redirect($this->Auth->redirectUrl());
}
// not logged
$this->Flash->error('Your username or password is incorrect');
}
}
和缺省路由看起來像
Router::scope('/', function (RouteBuilder $routes) {
$routes->fallbacks(DashedRoute::class);
});
CakePHP中用戶登錄後引發錯誤
Error: A route matching "/" could not be found.
None of the currently connected routes match the provided parameters. Add a matching route to config/routes.php
當IMO它應該重定向到頁面(基於相關控制器)從哪裏登錄方法被執行。
登錄代碼基於that教程。
有什麼想法?
工程就像一個魅力。謝謝! – JackTheKnife