Ejemplo n.º 1
0
 public function dispatch(\Ctv\Route\Route $router, $response)
 {
     $controllerName = ucwords($router->getParams('controller'));
     $namespace = ucwords($router->getParams('App')) . '\\Controller\\' . $controllerName;
     if (\Ctv\Autoloader\App::validate($namespace)) {
         $reflection = new \ReflectionClass($namespace);
         if ($reflection->hasMethod($router->getParams('action'))) {
             $method = $reflection->getMethod($router->getParams('action'));
             $controller = $reflection->newInstance($router, $response);
             if ($args = $router->getParams('args')) {
                 $method->invokeArgs($controller, $args);
             } else {
                 $method->invoke($controller);
             }
             $this->__callOutPut($controller);
             //$this->close();
         } else {
             echo outformat($namespace, 'trace');
             echo outformat($router, 'trace');
             echo $router;
             die('Method not exists' . $namespace);
         }
     } else {
         echo $namespace . 'error 404';
     }
     die;
 }
Ejemplo n.º 2
0
 public function __toString()
 {
     $this->params['url_use'] = $this->url;
     //rtrim(,'/');
     return outformat($this->params);
 }
Ejemplo n.º 3
0
 public function __toString()
 {
     return outformat(array_merge(array('sysetem' => $this->properties), array('user' => $this->store)), 'var_export');
 }