I'm just starting with Phalcon and decided to slowly port all of my current apps on it. And first problem I've encountered is the redirection to login form. In INVO, the
beforeDispatch() contains call on
Dispatcher::forward(), which will display the login form simply anywhere the user actually is. Well, I don't really want this behaviour and want to redirect user to the page with login form instead.
So, I've replaced the
Response::redirect() but got kicked in the head by infinite loop. The issue is that even after redirection,
$dispatcher->getControllerName() still returns the previous controller and thus the ACL rule will fail again and so on.
Can I somehow tell dispatcher "you're done with this controller, forget about it" or am I actually doing it the wrong way? I simply want guest users to be redirected to the login form no matter what address they try to access.
My code is pretty much the same as the INVO, except for the replacement of the