65 \
Magento\Framework\
View\Result\PageFactory $pageFactory,
68 $this->_layout = $layout;
71 $this->_configScope = $configScope;
72 $this->_eventManager = $eventManager;
73 $this->_actionFlag = $actionFlag;
74 $this->page = $pageFactory->create(
true);
94 return $this->page->getLayout();
100 public function loadLayout($handles =
null, $generateBlocks =
true, $generateXml =
true, $addActionHandles =
true)
102 if ($this->_isLayoutLoaded) {
103 throw new \RuntimeException(
'Layout must be loaded only once.');
106 if (!empty($handles)) {
107 $this->
getLayout()->getUpdate()->addHandle($handles);
110 if ($addActionHandles) {
112 $this->page->initLayout();
121 if (!$generateBlocks) {
125 $this->_isLayoutLoaded =
true;
137 return $this->page->getDefaultLayoutHandle();
160 return $this->page->addPageLayoutHandles($parameters, $defaultHandle);
170 $this->page->getConfig()->publicBuild();
181 $this->page->getConfig()->publicBuild();
192 $this->page->getConfig()->publicBuild();
204 if ($this->_actionFlag->get(
'',
'no-renderLayout')) {
208 \Magento\Framework\Profiler::start(
'LAYOUT');
210 \Magento\Framework\Profiler::start(
'layout_render');
216 $this->_eventManager->dispatch(
'controller_action_layout_render_before');
217 $this->_eventManager->dispatch(
218 'controller_action_layout_render_before_' . $this->_request->getFullActionName()
221 $this->page->renderResult($this->_response);
222 \Magento\Framework\Profiler::stop(
'layout_render');
224 \Magento\Framework\Profiler::stop(
'LAYOUT');
236 $this->_isLayoutLoaded =
$value;
__construct(\Magento\Framework\View\LayoutInterface $layout, RequestInterface $request, ResponseInterface $response, \Magento\Framework\Config\ScopeInterface $configScope, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\View\Result\PageFactory $pageFactory, ActionFlag $actionFlag)
addPageLayoutHandles(array $parameters=[], $defaultHandle=null)
loadLayout($handles=null, $generateBlocks=true, $generateXml=true, $addActionHandles=true)
setIsLayoutLoaded($value)