file = $file_path; } } /** * 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; } public function isFragment() { $this->isFragment = true; } function __toString() { return __CLASS__; } }