Skip to content

Commit

Permalink
[Routing] changed interface of the router twig extension as we don't …
Browse files Browse the repository at this point in the history
…need a full router
  • Loading branch information
fabpot committed Mar 23, 2011
1 parent d228c11 commit 258c33c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Extension/RoutingExtension.php
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Bridge\Twig\Extension;

use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

/**
* Provides integration of the Routing component with Twig.
Expand All @@ -20,11 +20,11 @@
*/
class RoutingExtension extends \Twig_Extension
{
private $router;
private $generator;

public function __construct(RouterInterface $router)
public function __construct(UrlGeneratorInterface $generator)
{
$this->router = $router;
$this->generator = $generator;
}

/**
Expand All @@ -42,12 +42,12 @@ public function getFunctions()

public function getPath($name, array $parameters = array())
{
return $this->router->generate($name, $parameters, false);
return $this->generator->generate($name, $parameters, false);
}

public function getUrl($name, array $parameters = array())
{
return $this->router->generate($name, $parameters, true);
return $this->generator->generate($name, $parameters, true);
}

/**
Expand Down

0 comments on commit 258c33c

Please sign in to comment.