_root = Container::get("ROOT"); $this->_views = $this->_root . DIRECTORY_SEPARATOR . "views"; $this->_cache = $this->_root . DIRECTORY_SEPARATOR . "cache"; $mode = ($this->isDebug()) ? BladeOne::MODE_AUTO : BladeOne::MODE_FAST; $this->_blade = new BladeOne($this->_views, $this->_cache, $mode); } public static function getInstance() { if (self::$_instance == null) { self::$_instance = new Templating(); } return self::$_instance; } private function isDebug(): bool { $ret = true; if (isset($_ENV["DEBUG"])) { $ret = ($_ENV["DEBUG"] == "true"); } return $ret; } public function render(string $template, array $params = []): string { return $this->_blade->run($template, $params); } }