Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 9th, 2010  |  syntax: PHP  |  size: 0.50 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data