code_junkie

How to create foo.com/user in Zend?

Nov 13th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. $routes = array();
  2. $routes['entry'] = new Zend_Controller_Router_Route_Regex('SOME REGEX HERE',
  3. array(
  4. 'controller' => 'profile',
  5. 'action' => 'show'
  6. ),
  7. array(
  8. 'id' => "dsadsa", // maps first subpattern "(d+)" to "id" parameter
  9. 1 => 'id' // maps first subpattern "(d+)" to "id" parameter
  10. )
  11. );
  12.  
  13. $router->addRoutes($routes);
  14.  
  15. $routes = array();
  16.  
  17. $routes['entry'] = new Zend_Controller_Router_Route(
  18. ':userName',
  19. array(
  20. 'controller' => 'profile',
  21. 'action' => 'show'
  22. )
  23. );
Add Comment
Please, Sign In to add comment