Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 public function __construct($path = '')
 {
     parent::__construct();
     $this->path = $path;
     if (function_exists('mb_internal_charset')) {
         mb_internal_charset('UTF-8');
     }
     define('SMARTY_RESOURCE_CHAR_SET', 'UTF-8');
     $this->engine = new Smarty();
     $this->engine->setTemplateDir($path ? $path : Manager::getPublicPath() . '/templates');
     $this->engine->setCompileDir(Manager::getFrameworkPath() . '/var/templates');
     $this->engine->setCacheDir(Manager::getFrameworkPath() . '/var/cache');
     $this->engine->setConfigDir(Manager::getClassPath() . '/ui/smarty/configs');
     $this->engine->left_delimiter = '{{';
     $this->engine->right_delimiter = '}}';
     $this->context = array();
     $this->context('manager', Manager::getInstance());
 }