Пример #1
0
 /**
  * Constructor
  *
  * @param ObjectConfig $config   An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Reset the stack
     $this->_stack = array();
     $this->_mustache = new \Mustache_Engine(array('loader' => $this, 'cache' => $this->_cache ? $this->_cache_path : null, 'strict_callables' => $this->getConfig()->strict_callables, 'pragmas' => $this->getConfig()->pragmas, 'helpers' => $this->getFunctions()));
 }
Пример #2
0
 /**
  * Constructor
  *
  * @param ObjectConfig $config   An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Create the buffer if we are not using a file cache
     if (!$this->isCache()) {
         static::$__buffer = $this->getObject('filesystem.stream.factory')->createStream('kodekit-buffer://temp', 'w+b');
     }
 }
Пример #3
0
 /**
  * Constructor
  *
  * @param ObjectConfig $config   An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Set the markdown compiler
     if ($config->compiler) {
         $this->setCompiler($config->compiler);
     }
 }
Пример #4
0
 /**
  * Constructor
  *
  * @param ObjectConfig $config   An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Reset the stack
     $this->_stack = array();
     $this->_twig = new \Twig_Environment($this, array('cache' => $this->_cache ? $this->_cache_path : false, 'auto_reload' => $this->_cache_reload, 'debug' => $config->debug, 'autoescape' => $config->autoescape, 'strict_variables' => $config->strict_variables, 'optimizations' => $config->optimizations));
     //Register functions in twig
     foreach ($this->getFunctions() as $name => $callable) {
         $function = new \Twig_SimpleFunction($name, $callable);
         $this->_twig->addFunction($function);
     }
 }