public function setContentWithLayout(string $textContent, string $layout = 'Global', array $vars = []) { $this->compiler->setContents($textContent); if ($path = $this->resolver->getView("Layout\\{$layout}")) { $textContent = $this->compiler->compile([$path]); } $this->setVars($vars); $this->setContent($textContent); return $this; }