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; }
public function __toString() { $this->params['url_use'] = $this->url; //rtrim(,'/'); return outformat($this->params); }
public function __toString() { return outformat(array_merge(array('sysetem' => $this->properties), array('user' => $this->store)), 'var_export'); }