/** * @param $tagTextOrArray * * @return self */ protected function addChild($tagTextOrArray) { // a list of arguments to be passed to builder->make() if (is_array($tagTextOrArray) && !empty($tagTextOrArray)) { if (!isset($this->builder)) { throw new \InvalidArgumentException(sprintf('Builder not attached to tag `%s`', $this->tag)); } $tagName = $tagTextOrArray[0]; $props = isset($tagTextOrArray[1]) ? $tagTextOrArray[1] : []; $content = isset($tagTextOrArray[2]) ? $tagTextOrArray[2] : []; $tagTextOrArray = $this->builder->make($tagName, $props, $content); } array_push($this->content, $tagTextOrArray); return $this; }
public function buildHTML() { $this->HTML = Builder::make(); }