|
|||
|
Hi,
I'm trying to make a routing decition in my index.php based on some cookie information and on the controller, the visitor will be routed to. Example: I have a website with "static pages" (staticController) and some "restricted pages" (restrictedController). Further on I have (or not) a cookie telling me, if I can access the restriced pages. Now based on my cookie and the page, the visitor wants to see, I have to decide, where to route him. If he has no cookie and wants to see the restricted page, I will redirect to a special static page. If he has no cookie and wants to see a static page, it's ok. And so on. I want to know, what controller the router will choose, before the dispatch() of the front controller is being called. Is there a way to do this? |
|
|||
|
PHP Code:
PHP Code:
|
|
|||
|
That's almost all that I need myself, I think.
I want to put my Auth & ACL within a single preDispatch, so I don't have to repeat it for all my controllers. The problem I ran into was how to redirect to the login form when either fails (user isn't logged in or user does not have permission). Using Code:
$request->setControllerName('controllername')
1. How can I pass a $_GET variable as well (/controller/action?var=something)? 2. How can I have the rest of my preDispatch skipped? Just use Code:
return; |
![]() |
| Thread Tools | |
| Display Modes | |
|
|