Commit f04f777b authored by Tobias Schultze's avatar Tobias Schultze

use constants for url generator

available since symfony 2.3 which is also the requirement of silex master
parent 1f1fc4e6
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
namespace Silex\Application; namespace Silex\Application;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/** /**
* UrlGenerator trait. * UrlGenerator trait.
* *
...@@ -28,7 +30,7 @@ trait UrlGeneratorTrait ...@@ -28,7 +30,7 @@ trait UrlGeneratorTrait
*/ */
public function path($route, $parameters = array()) public function path($route, $parameters = array())
{ {
return $this['url_generator']->generate($route, $parameters, false); return $this['url_generator']->generate($route, $parameters, UrlGeneratorInterface::ABSOLUTE_PATH);
} }
/** /**
...@@ -41,6 +43,6 @@ trait UrlGeneratorTrait ...@@ -41,6 +43,6 @@ trait UrlGeneratorTrait
*/ */
public function url($route, $parameters = array()) public function url($route, $parameters = array())
{ {
return $this['url_generator']->generate($route, $parameters, true); return $this['url_generator']->generate($route, $parameters, UrlGeneratorInterface::ABSOLUTE_URL);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment