/** * Запуск приложения * * @throws HTTPException */ public function run() { //Парсинг URI $parseResult = $this->router->parseUrl($this->request->getUri()); if ($parseResult) { $this->controller = $this->createController(); $this->controller->setName($this->router->getControllerClass()); $this->controller->setAction($this->router->getAction()); $this->controller->setRequest($this->request); $this->controller->run(); } }
public function __construct(Controller $controller, $viewName, $data) { $this->basePath = dirname(__FILE__) . '/../view/' . strtolower($controller->getName()) . '/'; $this->viewName = $viewName; $this->data = $data; }