/** * Set the body replacement view. * * @param View $view body view * * @throws RendererException */ public function body(View $view) { if ($view->getType() !== View::PART_BODY) { throw new RendererException("You are replacing the body with a non-body view!"); } if ($this->bodyKey === null) { throw new RendererException("No body is defined in the template!"); } $this->stack[$this->bodyKey] = $view; }