public function prepare() { parent::prepare(); $vd = ViewDispatcher::getInstance(); $this->setTemplateVariable('navigation_menu', $vd->renderView(new views\main_blocks\NavigationMenu())); $this->setLeftSidebar($vd); }
function process_request($handler, $vars, $httpMethod) { if (!is_array($handler)) { throw new ErrorException('Handler must be a an array'); } $controller = new $handler[0](); $manualParams = isset($handler[1]) ? $handler[1] : []; $controller->setMethod($httpMethod); $controller->setParams($vars + $manualParams); $controller->setGET($_GET); $controller->setPOST($_POST); $controller->setViewDispatcher(\view_engine\ViewDispatcher::getInstance()); return $controller->process(); }