Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PageFactory.php
Go to the documentation of this file.
1 <?php
8 
10 
20 {
24  private $objectManager;
25 
29  protected $instanceName;
30 
35  public function __construct(
36  ObjectManagerInterface $objectManager,
37  $instanceName = \Magento\Framework\View\Result\Page::class
38  ) {
39  $this->objectManager = $objectManager;
40  $this->instanceName = $instanceName;
41  }
42 
53  public function create($isView = false, array $arguments = [])
54  {
56  $page = $this->objectManager->create($this->instanceName, $arguments);
57  // TODO Temporary solution for compatibility with View object. Will be deleted in MAGETWO-28359
58  if (!$isView) {
59  $page->addDefaultHandle();
60  }
61  return $page;
62  }
63 }
__construct(ObjectManagerInterface $objectManager, $instanceName=\Magento\Framework\View\Result\Page::class)
Definition: PageFactory.php:35
$objectManager
Definition: bootstrap.php:17
$page
Definition: pages.php:8
$arguments