Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Layout.php
Go to the documentation of this file.
1 <?php
8 
11 
15 class Layout
16 {
22  protected $layout;
23 
30  public function __construct(
31  LayoutFactory $layoutFactory,
32  \Magento\Framework\View\LayoutInterface $generalLayout
33  ) {
34  $this->layout = $layoutFactory->create(['cacheable' => $generalLayout->isCacheable()]);
35  }
36 
43  public function addHandle($handle)
44  {
45  $this->layout->getUpdate()->addHandle($handle);
46  }
47 
53  public function loadLayout()
54  {
55  $this->layout->getUpdate()->load();
56  $this->layout->generateXml();
57  $this->layout->generateElements();
58  }
59 
66  public function getBlock($name)
67  {
68  return $this->layout->getBlock($name);
69  }
70 }
__construct(LayoutFactory $layoutFactory, \Magento\Framework\View\LayoutInterface $generalLayout)
Definition: Layout.php:30
$handle
if(!isset($_GET['name'])) $name
Definition: log.php:14