/** * @param \Application $app * @return \Symfony\Component\HttpFoundation\Response */ public function index(\Application $app) { return $app->render('admin.twig'); }
/** * Renders response from controller action * * @param string $controllerInstance Controller * @param Response $response Response to render * @return string Renderer content * @throws ViewNotFoundException if view does not exists for specified controller */ protected function render(Controller $controllerInstance, Response $response, $actionName = null) { $this->logStat('Before page rendering'); $output = parent::render($controllerInstance, $response, $actionName); if ($cache = $controllerInstance->getCacheHandler()) { $cache->setData($output); $cache->save(); } $this->logStat('Finished page rendering'); return $output; }
<?php define('DACCESS', 1); require 'framework.php'; $app = new Application(); $app->route(); $app->dispatch(); $app->render();
/** * @param \Application $app * @param string $name * @return \Symfony\Component\HttpFoundation\Response */ public function name(\Application $app, $name) { return $app->render('index.twig', array('name' => $name)); }
} $item = str_replace("_", " ", $item); $item = ucwords($item); $top_menu .= "<a href='" . Application::getLink($link) . "'><span>{$item}</span></a>"; } Application::$templateEngine->assign('top_menu', $top_menu); } } } // Log the route into the audit trail if it is enabled if ($_SESSION['logged_in'] == true && $_GET['q'] != 'system/api/table' && ENABLE_AUDIT_TRAILS === true) { $data = json_encode(array('route' => $_GET['q'], 'request' => $_REQUEST, 'get' => $_GET, 'post' => $_POST)); if (class_exists("SystemAuditTrailModel", false) && ENABLE_ROUTING_TRAILS === true) { SystemAuditTrailModel::log(array('item_id' => '0', 'item_type' => 'routing_activity', 'description' => "Accessed [{$_GET['q']}]", 'type' => SystemAuditTrailModel::AUDIT_TYPE_ROUTING, 'data' => $data)); } } // Load the styleseets and the javascripts if ($GLOBALS['fapi_stylesheet'] === false) { Application::preAddStylesheet("css/fapi.css", Application::getWyfHome("fapi/")); } else { Application::preAddStylesheet($GLOBALS['fapi_stylesheet']); } Application::preAddStylesheet("kalendae/kalendae.css", Application::getWyfHome('assets/js/')); Application::preAddStylesheet("css/main.css"); Application::addStylesheet('css/rapi.css', Application::getWyfHome('rapi/')); Application::addJavaScript(Application::getLink(Application::getWyfHome("fapi/js/fapi.js"))); Application::addJavaScript(Application::getLink(Application::getWyfHome("assets/js/jquery.js"))); Application::addJavaScript(Application::getLink(Application::getWyfHome("assets/js/kalendae/kalendae.js"))); // Blast the HTML code to the browser! Application::render();
function layoutAction(Request $request, \Application $app) { return $app->render('Application/Layout/layout.twig'); }