public function __construct($path = '') { if (function_exists('mb_internal_charset')) { mb_internal_charset('UTF-8'); } $this->engine = new \Latte\Engine(); $this->path = $path ?: Manager::getPublicPath() . '/templates'; $this->engine->setTempDirectory(sys_get_temp_dir()); $this->engine->getParser()->defaultSyntax = 'double'; $this->engine->addFilter('translate', function ($s) { return _M($s); }); $this->context = array(); $this->context('manager', Manager::getInstance()); }