/** * Returns rendered markup * * @return string */ public function render() { $this->onBeforeRender(); if (!$this->visible) { return ''; } $viewRenderer = INSTALL::getViewRenderer(); $vars = $viewRenderer->getAllAssignedVars(); $viewRenderer->clearAssignedVars(); $viewRenderer->assignVars($this->assignedVars); $renderedMarkup = $viewRenderer->render($this->template); $viewRenderer->clearAssignedVars(); $viewRenderer->assignVars($vars); return $renderedMarkup; }
public function display($dbReady) { $dispatchAttrs = OW::getRouter()->route(); $controllerClass = $dispatchAttrs['controller']; /* @var $controller INSTALL_ActionController */ $controller = new $controllerClass(); $controller->init($dispatchAttrs, $dbReady); $params = array(); if (!empty($dispatchAttrs['vars'])) { $params[] = $dispatchAttrs['vars']; } call_user_func_array(array($controller, $dispatchAttrs['action']), $params); $template = $controller->getTemplate(); if (empty($template)) { $controllerName = OW::getAutoloader()->classToFilename($controllerClass, false); $template = INSTALL_DIR_VIEW_CTRL . $controllerName . '_' . UTIL_String::capsToDelimiter($dispatchAttrs['action'], '_') . '.php'; $controller->setTemplate($template); } $content = $controller->render(); $viewRenderer = INSTALL::getViewRenderer(); $viewRenderer->assignVars(array('pageBody' => $content, 'pageTitle' => $controller->getPageTitle(), 'pageHeading' => $controller->getPageHeading(), 'pageSteps' => INSTALL::getStepIndicator()->render(), 'pageStylesheetUrl' => INSTALL_URL_VIEW . 'style.css')); echo $viewRenderer->render(INSTALL_DIR_VIEW . 'master_page.php'); }