Add cache warmed routers support to RouteHelper
This commit is contained in:
parent
6790e45911
commit
218a9ae51e
@ -86,4 +86,14 @@ class CachedRouter implements RouterInterface
|
|||||||
{
|
{
|
||||||
return $this->matcher->match($url);
|
return $this->matcher->match($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the UrlGenerator instance associated with this Router.
|
||||||
|
*
|
||||||
|
* @return UrlGeneratorInterface A UrlGeneratorInterface instance
|
||||||
|
*/
|
||||||
|
public function getGenerator()
|
||||||
|
{
|
||||||
|
return $this->generator;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
namespace Symfony\Bundle\FrameworkBundle\Templating\Helper;
|
namespace Symfony\Bundle\FrameworkBundle\Templating\Helper;
|
||||||
|
|
||||||
use Symfony\Component\Templating\Helper\Helper;
|
use Symfony\Component\Templating\Helper\Helper;
|
||||||
use Symfony\Component\Routing\Router;
|
use Symfony\Component\Routing\RouterInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RouterHelper manages links between pages in a template context.
|
* RouterHelper manages links between pages in a template context.
|
||||||
@ -26,9 +26,9 @@ class RouterHelper extends Helper
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param Router $router A Router instance
|
* @param RouterInterface $router A Router instance
|
||||||
*/
|
*/
|
||||||
public function __construct(Router $router)
|
public function __construct(RouterInterface $router)
|
||||||
{
|
{
|
||||||
$this->generator = $router->getGenerator();
|
$this->generator = $router->getGenerator();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user