/** * executes all controllers and compile the final HTML Document. * * @return string finalHTML */ public function execute() { if (HANDHELD) { header('Pragma: public'); header("Expires: " . gmdate("Y-m-d\\TH:i:s\\Z", time() + 60 * 30)); header('Cache-Control: no-store, must-revalidate, post-check=0, pre-check=0, no-transform, max-age=1800'); } foreach ($this->mountPoints as $column => $controllers) { ${$column} = ""; foreach ($controllers as $c) { ${$column} .= $c->execute(); } } $pageTitle = $this->title; $pageDescription = $this->description; $bodyClass = $this->bodyClass; foreach (registry::getInstance() as $k => $v) { ${$k} = $v; } isset($contentType) ? http_response::content($contentType) : http_response::content(CONTENT_TYPE); ob_start(); require $this->file; // output is gzipped and minified (NO; PROBLEMS WITH CODE BLOCKS!). // ob_postprocess(trim(preg_replace('/\s+/', ' ', ob_get_clean()))); echo ob_get_clean(); }
/** * Compile the view * * @return $HTMLSource the compiled view */ public function compile() { $registry =& registry::getInstance(); $user =& user::getInstance(); foreach ($registry->fetchWhole() as $k => $v) { ${$k} = $v; } ob_start(); require $this->file; $body = ob_get_clean(); isset($contentType) ? http_response::content($contentType) : http_response::content(CONTENT_TYPE); if ($this->hasLayout) { ob_start(); require strchr($bodyid, 'admin') ? LAYOUT_ADMIN : LAYOUT; return ob_get_clean(); } else { return $body; } }
/** * Compile the view * * @return $HTMLSource the compiled view */ public function compile($registry = false) { if ($registry === false) { $registry =& registry::getInstance(); } $user =& user::getInstance(); foreach ($registry as $k => $v) { ${$k} = $v; } ob_start(); require $this->file; $body = ob_get_clean(); isset($contentType) ? http_response::content($contentType) : http_response::content(CONTENT_TYPE); $isFragment = isset($this->isFragment); if (defined('LAYOUT') && !$isFragment) { ob_start(); require LAYOUT; $body = ob_get_clean(); } return $body; }