Guest User

Untitled

a guest
Jan 13th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <h1>Miku Magic</h1>
  2. <?php
  3. $configuration = array(
  4. "controllerPath" => "../application/controllers/"
  5. );
  6.  
  7. function controller($options) {
  8. global $configuration;
  9.  
  10. if(!is_array($options))
  11. die("controller(): incorrect arguments");
  12.  
  13. include($configuration["controllerPath"] . $options["controller"] . ".php");
  14.  
  15. $controller = new Controller;
  16. $controller->run(array(
  17. "action" => $options["action"]
  18. ));
  19. }
  20.  
  21. controller(array(
  22. "controller" => $_GET["controller"],
  23. "action" => $_GET["action"]
  24. ));
  25.  
  26. ?>
Add Comment
Please, Sign In to add comment