Find out controller name BEFORE dispatcher call
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?
|