/** * 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; }
/** * 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; }
public function __construct() { parent::__construct(); }