예제 #1
0
파일: Engine.php 프로젝트: dmitriz/Platform
 /**
  * factory method
  *
  * @param array $options see __construct's options parameter
  *
  * @return {Handlebars}
  */
 public static function factory($options = array())
 {
     if (self::$_instance === false) {
         self::$_instance = new Handlebars_Engine($options);
     }
     return self::$_instance;
 }
예제 #2
0
 /**
  * Process partial section
  *
  * @param Handlebars_Context $context current context
  * @param array              $current section node data
  * @param boolean            $escaped escape result or not
  *
  * @return string the result
  */
 private function _variables($context, $current, $escaped)
 {
     $name = $current[Handlebars_Tokenizer::NAME];
     $value = $context->get($name);
     if ($name == '@index') {
         return $context->lastIndex();
     }
     if ($name == '@key') {
         return $context->lastKey();
     }
     if ($escaped) {
         $args = $this->handlebars->getEscapeArgs();
         array_unshift($args, $value);
         $value = call_user_func_array($this->handlebars->getEscape(), array_values($args));
     }
     return $value;
 }
예제 #3
0
 public function __construct()
 {
     parent::__construct();
 }