public function __construct($file, $values = array()) { self::$current = $this; // Include the template's helper functions, if there are any if (file_exists(HELPERS_PATH . "{$file}.php")) { require HELPERS_PATH . "{$file}.php"; } $position = strpos($file, '/'); if ($position === FALSE) { $this->file = TEMPLATES_PATH . $file . '.php'; } elseif ($position === 0) { $this->file = TEMPLATES_PATH . substr($file, 1) . '.php'; } else { $this->file = TEMPLATES_PATH . $file . '.php'; } $this->set($values); }
function end_block () { return Template::current()->end_block(); }