private createUrlHelperFactory ( Interop\Container\ContainerInterface $services ) : callable | ||
$services | Interop\Container\ContainerInterface | |
Résultat | 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;
};
}