Advertisement
Guest User

Untitled

a guest
Dec 9th, 2010
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. class My_Route {
  2.    
  3.     public static function buildRoute($action='index', $controller=null, $module=null, $params=null)
  4.     {
  5.         $opts = array();
  6.  
  7.         $opts['action'] = $action;
  8.         $opts['controller'] = $controller;
  9.         $opts['module'] = $module;
  10.  
  11.         if ($params){
  12.             foreach ($params as $key => $value){
  13.                 $opts[$key] = $value;
  14.             }
  15.         }
  16.  
  17.         $router = Zend_Controller_Front::getInstance()->getRouter();
  18.         $url = $router->assemble($opts, null, true);
  19.  
  20.         return $url;
  21.     }
  22.  
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement