I am a beginner in CakePHP and am working on an existing CakePHP site.
Scenario: is whenever I try to access a page directly through URL, it lands on Login page.
For instance this is my register page. It has a submit button. When I click this submit button it lands on login page and sets the flash message to 'registered successfully'. I wouldn't want that. What I expected was a redirect to some other page.
In register()
function of the respective controller I found this code, which is responsible for the redirection to login page:
else {
$this->Session->setFlashMessage(__('You have registered successfully!!
An e-mail has been sent for activation.
Please check!') , 'success');
$redirect_url = Router::url(array(
'controller' => 'users',
'action' => 'login'
) , true);
}
When I changed the redirection URL to the new page where i want to redirect like
'controller' => 'new_controller',
'action' => 'index'
.. it still lands on login page!
What am I doing wrong here?