Example #1
0
 /**
  * Gets a block node from the specified tag command by searching for the
  * tag class, instructing the tag to process the supplied data, and
  * returning the resulting {@link \hydrogen\view\engines\hydrogen\Node}.
  *
  * Note that "BlockNode" can refer to two different things.  This function
  * produces a node from any generic block tag; it does not retrieve an
  * instance of {@link \hydrogen\view\engines\hydrogen\nodes\BlockNode}
  * unless such a result would be appropriate given the tag command.
  *
  * @param string $origin The template name in which the block tag was
  * 		found.
  * @param string $cmd The tag command for which to produce a node.
  */
 protected function getBlockNode($origin, $cmd, $args)
 {
     $class = HydrogenEngine::getTagClass($cmd, $origin);
     if ($class::mustBeFirst() && $this->originHasNodes($origin)) {
         throw new TemplateSyntaxException("Tag must be first in template: {$cmd}");
     }
     return $class::getNode($cmd, $args, $this, $origin);
 }