classes/bfw/Dispatcher.php
changeset 9 8c2f3735a9bd
parent 8 54ea0099329c
child 11 16e5372a872e
equal deleted inserted replaced
8:54ea0099329c 9:8c2f3735a9bd
     6  */
     6  */
     7 
     7 
     8 namespace bfw;
     8 namespace bfw;
     9 
     9 
    10 use bfw\core\Controller;
    10 use bfw\core\Controller;
       
    11 use bfw\core\Model;
    11 use bfw\core\View;
    12 use bfw\core\View;
    12 use bfw\entities\TView;
       
    13 use ReflectionClass;
    13 use ReflectionClass;
    14 use ReflectionException;
    14 use ReflectionException;
    15 
    15 
    16 class Dispatcher {
    16 class Dispatcher {
    17     private $request;
    17     private $request;
    60 
    60 
    61             // Mapping vom GET-Parameter 'action' auf Controller::$action()
    61             // Mapping vom GET-Parameter 'action' auf Controller::$action()
    62             if (!$reflection->hasMethod($action)) {
    62             if (!$reflection->hasMethod($action)) {
    63                 $action = 'index';
    63                 $action = 'index';
    64             }
    64             }
    65         } catch (ReflectionException $e) {
    65         } catch (ReflectionException $re) {
    66             $controller = new mvc\controller\ErrorController(new TView('NON_EXISTENT'));
    66             $controller = new mvc\controller\ErrorController(new Model());
    67 
    67 
    68             $controllerName = 'error';
    68             $controllerName = 'error';
    69             $action = 'index';
    69             $action = 'index';
    70         }
    70         }
    71 
    71