Advertisement
joserobertocordeiro

Untitled

May 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2. class Core{
  3.  
  4. private $currentController;
  5. private $currentAction;
  6.  
  7. public function run(){
  8. $url = substr($_SERVER['PHP_SELF'], 10);
  9.  
  10. if(!empty($url)){
  11. $url = explode('/', $url);
  12. array_shift($url);
  13.  
  14. $this->currentController = $url[0].'Controller';
  15.  
  16. if(isset($url[1]){
  17. $this->currentAction = $url[1];
  18.  
  19. }else{
  20. $this->currentAction = 'index';
  21. }
  22.  
  23. }else{
  24. $this->currentController = 'homeController';
  25. $this->currentAction = 'index';
  26. }
  27.  
  28. }
  29. }
  30.  
  31.  
  32.  
  33.  
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement