Пример #1
0
 /**
  * Process section nodes
  *
  * @param Context $context current context
  * @param array   $current section node data
  *
  * @throws \RuntimeException
  * @return string the result
  */
 private function _section(Context $context, $current)
 {
     $helpers = $this->handlebars->getHelpers();
     $sectionName = $current[Tokenizer::NAME];
     if ($helpers->has($sectionName)) {
         return $this->_handlebarsStyleSection($context, $current);
     } elseif (trim($current[Tokenizer::ARGS]) == '') {
         return $this->_mustacheStyleSection($context, $current);
     } else {
         throw new \RuntimeException(sprintf('"%s"" is not registered as a helper', $sectionName));
     }
 }