Skip to content

Commit

Permalink
Merge remote branch 'aurelijus/routehelper_cachedrouter_fix'
Browse files Browse the repository at this point in the history
* aurelijus/routehelper_cachedrouter_fix:
  Add cache warmed routers support to RouteHelper
  • Loading branch information
fabpot committed Mar 6, 2011
2 parents c6bbecf + 218a9ae commit c2e0537
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/Routing/CachedRouter.php
Expand Up @@ -86,4 +86,14 @@ public function 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;
}
}
Expand Up @@ -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.
Expand All @@ -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();
}
Expand Down

0 comments on commit c2e0537

Please sign in to comment.