pageConfig = $pageConfig; $this->pageLayoutReader = $pageLayoutReader; $this->pageConfig->setBuilder($this); } /** * Read page layout before generation generic layout * * @return $this */ protected function generateLayoutBlocks() { $this->readPageLayout(); return parent::generateLayoutBlocks(); } /** * Read page layout and write structure to ReadContext * @return void */ protected function readPageLayout() { $pageLayout = $this->getPageLayout(); if ($pageLayout) { $readerContext = $this->layout->getReaderContext(); $this->pageLayoutReader->read($readerContext, $pageLayout); } } /** * @return string */ protected function getPageLayout() { return $this->pageConfig->getPageLayout() ?: $this->layout->getUpdate()->getPageLayout(); } }