0

PLOT:

After implementing ACL on my website, if a user tries to access unauthorised page he will be denied and shown a page to login. After he loggs in, I wanted to redirect the user to the previous page to which he was denied to earlier.

To do this, I store the request parameters using $request -> getParams(), onto a session variable, which will be used to generate the url again. This is where the problem occurs, to generate the url back, I need the name of the route and that i dont know how to read.

I need to know the route name, so that I will be able to regenerate the url, from the array stored in session, or if there is a better way to solve this, please suggest.

mrN
  • 3,734
  • 15
  • 58
  • 82
  • This has been answered here : [http://stackoverflow.com/questions/1373573/how-to-get-the-dispatched-route-name-in-zend-framework](http://stackoverflow.com/questions/1373573/how-to-get-the-dispatched-route-name-in-zend-framework) – Frederik Eychenié Sep 21 '11 at 14:44

2 Answers2

0

Why not just store $request->getRequestUri()? This will give you the URL as it appears in the browser.

Phil
  • 157,677
  • 23
  • 242
  • 245
-1

Dont try to think of complex solutions for simple problem.

You can do this, with just using $_SERVER['REQUEST_URI'], this gives the same result as @Phil's answer (Correct me, If i am missing something). and is more than enough to do what you want.

Starx
  • 77,474
  • 47
  • 185
  • 261
  • 2
    Using `Zend_Controller_Request_Http::getRequestUri()` handles the differences between various web servers, making the script much more portable. – Phil Sep 22 '11 at 02:05