Commit 4c62c283 authored by Fabien Potencier's avatar Fabien Potencier

merged branch Tobion/patch-2 (PR #766)

This PR was merged into the master branch.

Discussion
----------

use constants for url generator

available since symfony 2.3 which is also the requirement of silex master

Commits
-------

f04f777b use constants for url generator
parents 1f1fc4e6 f04f777b
......@@ -11,6 +11,8 @@
namespace Silex\Application;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* UrlGenerator trait.
*
......@@ -28,7 +30,7 @@ trait UrlGeneratorTrait
*/
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
*/
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