Example #1
0
 /**
  * Create tag entity
  * @param string $name the tag name
  * @param Template $tpl current template
  * @param string $info tag's information
  * @param string $body template's code
  */
 public function __construct($name, Template $tpl, $info, &$body)
 {
     $this->tpl = $tpl;
     $this->name = $name;
     $this->line = $tpl->getLine();
     $this->level = $tpl->getStackSize();
     $this->_body =& $body;
     $this->_offset = strlen($body);
     $this->_type = $info["type"];
     $this->escape = $tpl->getOptions() & \Fenom::AUTO_ESCAPE;
     if ($this->_type & self::BLOCK) {
         $this->_open = $info["open"];
         $this->_close = $info["close"];
         $this->_tags = isset($info["tags"]) ? $info["tags"] : array();
         $this->_floats = isset($info["float_tags"]) ? $info["float_tags"] : array();
         $this->_closed = false;
     } else {
         $this->_open = $info["parser"];
     }
     if ($this->_type & self::FUNC) {
         $this->callback = $info["function"];
     }
 }