Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Factory.php
Go to the documentation of this file.
1 <?php
7 
10 
11 class Factory
12 {
16  protected $objectManager;
17 
22  {
23  $this->objectManager = $objectManager;
24  }
25 
34  public function createRoute($routeClass, $route)
35  {
36  $route = $this->objectManager->create($routeClass, ['route' => $route]);
37  if (!$route instanceof RouterInterface) {
38  throw new \LogicException('Route must implement "Magento\Framework\App\RouterInterface".');
39  }
40  return $route;
41  }
42 }
__construct(ObjectManager $objectManager)
Definition: Factory.php:21