Я хочу, чтобы при входе пользователи перенаправлялись на действие индекса записей.Но вместо этого они перенаправляются на действия добавления сообщений.ниже мой мой route.php
Router::connect('/', array('controller' => 'posts', 'action' => 'index'));
/**
* ...and connect the rest of 'Pages' controller's urls.
*/
Router::connect('/pages/*', array('controller' => 'posts', 'action' => 'index'));
, и мое действие по входу в пользовательский контроллер -
public function login() {
if ($this->request->is('post')) {
if ($this->Auth->login()) {
$this->redirect($this->Auth->redirect());
} else {
$this->Session->setFlash('Your username or password was incorrect.');
}
}
}
** DEBUG **
, когда я отлаживал при входе в систему,Я получаю это
/app/Controller/UsersController.php (line 20)
object(AuthComponent) {
components => array(
(int) 0 => 'Session',
(int) 1 => 'RequestHandler'
)
authenticate => array(
(int) 0 => 'Form'
)
authorize => array(
'Actions' => array(
'actionPath' => 'controllers'
)
)
ajaxLogin => null
flash => array(
'element' => 'default',
'key' => 'auth',
'params' => array()
)
loginAction => array(
'controller' => 'users',
'action' => 'login'
)
loginRedirect => array(
'controller' => 'posts',
'action' => 'add'
)
logoutRedirect => array(
'controller' => 'users',
'action' => 'login'
)
по какой-то причине оно говорит:
loginRedirect => array ('controller' => 'posts', 'action' => 'add')
вместо action => index - unsing action => add.Почему