示例#1
0
 /**
  * Process variable
  *
  * @param Context $context current context
  * @param array   $current section node data
  * @param boolean $escaped escape result or not
  *
  * @return string the result
  */
 private function _getVariable(Context $context, $current, $escaped)
 {
     $name = $current[Tokenizer::NAME];
     $value = $context->get($name);
     if (is_array($value)) {
         return 'Array';
     }
     if ($escaped && !$value instanceof SafeString) {
         $args = $this->handlebars->getEscapeArgs();
         array_unshift($args, (string) $value);
         $value = call_user_func_array($this->handlebars->getEscape(), array_values($args));
     }
     return (string) $value;
 }