/** * Rendering layout * * @param string $output * @return $this */ public function renderLayout($output = '') { if ($this->_actionFlag->get('', 'no-renderLayout')) { return $this; } \Magento\Framework\Profiler::start('LAYOUT'); \Magento\Framework\Profiler::start('layout_render'); if ('' !== $output) { $this->getLayout()->addOutputElement($output); } $this->_eventManager->dispatch('controller_action_layout_render_before'); $this->_eventManager->dispatch('controller_action_layout_render_before_' . $this->_request->getFullActionName()); $this->page->renderResult($this->_response); \Magento\Framework\Profiler::stop('layout_render'); \Magento\Framework\Profiler::stop('LAYOUT'); return $this; }