Advertisement
Guest User

Untitled

a guest
Dec 17th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. $paramStr = "";
  3. $paramCount = count(explode("/",$foo=$_SERVER['REQUEST_URI']))-1;
  4. for($i=2;$i<=$paramCount;$i++) {
  5. $paramStr .='/.+';
  6. }
  7.  
  8. $route->add($paramStr, function($controller,$action,$param1=null,$param2=null,$param3=null) {
  9. $container = new Helpers\Container();
  10. $action=$action.'Action';
  11. // Do some check to see if class/action exists. Throw default if not.
  12. echo $container[$controller.'controller']->$action($param1,$param2,$param3);       
  13. });
  14. $route->submit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement