/** * @param array $attrs * @param Block $parentNode * @param bool $cold */ public function __construct($attrs, $parentNode, $cold = false) { $this->parentNode = $parentNode; $this->req = $this->parentNode instanceof Request ? $this->parentNode : $this->parentNode->req; $this->parentNode->inner[] = $this; end($this->parentNode->inner); $this->_nid = key($this->parentNode->inner); foreach ($attrs as $key => $value) { $this->{$key} = $value; } $this->attrs = $attrs; unset($this->attrs['template'], $this->attrs['templatePHP'], $this->attrs['cachekey'], $this->attrs['tag']); if ($cold) { return; } if (!$this->req->getBlock($this)) { $this->init(); } }