aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/controller/helper.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-09-04 17:12:25 +0200
committerTristan Darricau <github@nicofuma.fr>2014-09-16 19:28:06 +0200
commitdab6b99bcda411027d040c3b985460990f2a117a (patch)
treead3c6d687e0033547fd1c6df0e4b66bd1c76b5fd /phpBB/phpbb/controller/helper.php
parentb3576d77da20acc65e5ec9456229e0f269f7d849 (diff)
downloadforums-dab6b99bcda411027d040c3b985460990f2a117a.tar
forums-dab6b99bcda411027d040c3b985460990f2a117a.tar.gz
forums-dab6b99bcda411027d040c3b985460990f2a117a.tar.bz2
forums-dab6b99bcda411027d040c3b985460990f2a117a.tar.xz
forums-dab6b99bcda411027d040c3b985460990f2a117a.zip
[ticket/13036] Make the reference type configurable when generating a route
PHPBB3-13036
Diffstat (limited to 'phpBB/phpbb/controller/helper.php')
-rw-r--r--phpBB/phpbb/controller/helper.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index e5e54fac00..77fe5cb3a8 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -15,6 +15,7 @@ namespace phpbb\controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGenerator;
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RequestContext;
/**
@@ -115,10 +116,11 @@ class helper
* @param string $route Name of the route to travel
* @param array $params String or array of additional url parameters
* @param bool $is_amp Is url using &amp; (true) or & (false)
- * @param string|bool $session_id Possibility to use a custom session id instead of the global one
+ * @param string|bool $session_id Possibility to use a custom session id instead of the global one
+ * @param bool|string $reference_type The type of reference to be generated (one of the constants)
* @return string The URL already passed through append_sid()
*/
- public function route($route, array $params = array(), $is_amp = true, $session_id = false)
+ public function route($route, array $params = array(), $is_amp = true, $session_id = false, $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)
{
$anchor = '';
if (isset($params['#']))
@@ -146,7 +148,7 @@ class helper
$context->setBaseUrl($base_url);
$url_generator = new UrlGenerator($this->route_collection, $context);
- $route_url = $url_generator->generate($route, $params);
+ $route_url = $url_generator->generate($route, $params, $reference_type);
if ($is_amp)
{