Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
LayoutFactory.php
Go to the documentation of this file.
1 <?php
8 
10 
16 {
20  private $objectManager;
21 
25  protected $instanceName;
26 
31  public function __construct(
33  $instanceName = \Magento\Framework\View\Result\Layout::class
34  ) {
35  $this->objectManager = $objectManager;
36  $this->instanceName = $instanceName;
37  }
38 
42  public function create()
43  {
45  $resultLayout = $this->objectManager->create($this->instanceName);
46  $resultLayout->addDefaultHandle();
47  return $resultLayout;
48  }
49 }
$objectManager
Definition: bootstrap.php:17
__construct(ObjectManagerInterface $objectManager, $instanceName=\Magento\Framework\View\Result\Layout::class)