Guest User

Untitled

a guest
Jun 21st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. $url = $_SERVER['REQUEST_URI'];
  4. $array = explode("/", $url);
  5. $action = 'index';
  6. $dispatch = new $array[1];
  7. if(method_exists($dispatch, $action))
  8. {
  9. call_user_func_array(array($dispatch, $action), $args);
  10. }
  11.  
  12.  
  13. /** Controller object to be found in another file but here for example purposes **/
  14. class Blog_Controller extends Controller
  15. {
  16. /** $postReference would be where $args in the example
  17. * above is employed
  18. **/
  19. public function viewPost($postReference)
  20. {
  21.  
  22. }
  23. }
Add Comment
Please, Sign In to add comment