Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1.     $params = explode('/', $_SERVER['REQUEST_URI']);
  2.  
  3.     foreach($params as $key => $param) {   
  4.         if (empty($param)) {
  5.             unset($params[$key]);
  6.             continue;
  7.         }
  8.        
  9.         if (file_exists('application/class/'.$param.'.php')) {
  10.             $controller = new $param($db);
  11.             unset($params[$key]);
  12.         }
  13.        
  14.         if (isset($controller)) {
  15.             if (method_exists($controller, $param)) {
  16.                 $action = $param;
  17.                 unset($params[$key]);
  18.             }
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement