public function testEnableDisableLayout() { $this->controller->disableLayout(); $this->assertFalse($this->controller->hasLayoutEnabled()); $this->controller->enableLayout(); $this->assertTrue($this->controller->hasLayoutEnabled()); }
/** * @return string * @throws \Exception */ private function getResponseBody() { /** @var \stdClass $view_vars */ $view_vars = $this->controller->view; $response_body = $this->controller->getBody(); if ($this->controller->hasViewEnabled()) { $view = $this->config['controller'] . '/' . $this->config['action'] . '.twig'; try { $response_body = $this->controller->getTwig()->render($view, (array) $view_vars); } catch (\Exception $e) { throw $e; } } if ($this->controller->hasLayoutEnabled()) { $response_body = $this->templateCheck($this->controller, $response_body, (array) $view_vars); } return $response_body; }