Zend\Mvc\Service\ViewHelperManagerFactory::createUrlHelperFactory PHP 메소드

createUrlHelperFactory() 개인적인 메소드

Retrieves the application and router from the servicemanager, and the route match from the MvcEvent composed by the application, using them to configure the helper.
private createUrlHelperFactory ( Interop\Container\ContainerInterface $services ) : callable
$services Interop\Container\ContainerInterface
리턴 callable
    private function createUrlHelperFactory(ContainerInterface $services)
    {
        return function () use($services) {
            $helper = new ViewHelper\Url();
            $helper->setRouter($services->get('HttpRouter'));
            $match = $services->get('Application')->getMvcEvent()->getRouteMatch();
            if ($match instanceof RouteMatch) {
                $helper->setRouteMatch($match);
            }
            return $helper;
        };
    }