Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Builder.php
Go to the documentation of this file.
1 <?php
7 
11 
15 class Builder extends View\Layout\Builder
16 {
20  protected $pageConfig;
21 
25  protected $pageLayoutReader;
26 
34  public function __construct(
36  App\Request\Http $request,
40  ) {
41  parent::__construct($layout, $request, $eventManager);
42  $this->pageConfig = $pageConfig;
43  $this->pageLayoutReader = $pageLayoutReader;
44  $this->pageConfig->setBuilder($this);
45  }
46 
52  protected function generateLayoutBlocks()
53  {
54  $this->readPageLayout();
55  return parent::generateLayoutBlocks();
56  }
57 
62  protected function readPageLayout()
63  {
64  $pageLayout = $this->getPageLayout();
65  if ($pageLayout) {
66  $readerContext = $this->layout->getReaderContext();
67  $this->pageLayoutReader->read($readerContext, $pageLayout);
68  }
69  }
70 
74  protected function getPageLayout()
75  {
76  return $this->pageConfig->getPageLayout() ?: $this->layout->getUpdate()->getPageLayout();
77  }
78 }
__construct(View\LayoutInterface $layout, App\Request\Http $request, Event\ManagerInterface $eventManager, Config $pageConfig, Layout\Reader $pageLayoutReader)
Definition: Builder.php:34