objectManager = $objectManager; } /** * Create route instance. * * @param string $routeClass * @param string $route Map used to match with later submitted URL path * @return RouterInterface * @throws \LogicException If specified route class does not implement proper interface. */ public function createRoute($routeClass, $route) { $route = $this->objectManager->create($routeClass, ['route' => $route]); if (!$route instanceof RouterInterface) { throw new \LogicException('Route must implement "Magento\Framework\App\RouterInterface".'); } return $route; } }