Merge remote branch 'aurelijus/routehelper_cachedrouter_fix'
* aurelijus/routehelper_cachedrouter_fix: Add cache warmed routers support to RouteHelper
This commit is contained in:
commit
c2e0537c31
@ -86,4 +86,14 @@ class CachedRouter implements RouterInterface
|
||||
{
|
||||
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;
|
||||
|
||||
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.
|
||||
@ -26,9 +26,9 @@ class RouterHelper extends Helper
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user