[ticket/11334] Expand functionality of helper->url()

Expanded the functionality of helper->url() to support all parameters of
append_sid() itself.

PHPBB3-11334
This commit is contained in:
Joas Schilling 2013-03-15 13:35:43 +01:00 committed by David King
parent cd697e6812
commit ff9a0e4ef4

View file

@ -88,11 +88,29 @@ class phpbb_controller_helper
* Generate a URL
*
* @param string $route The route to travel
* @param mixed $params String or array of additional url parameters
* @param bool $is_amp Is url using & (true) or & (false)
* @param string $session_id Possibility to use a custom session id instead of the global one
* @return string The URL already passed through append_sid()
*/
public function url($route)
public function url($route, $params = false, $is_amp = true, $session_id = false)
{
return append_sid($this->phpbb_root_path . 'app' . $this->php_ext, array('controller' => $route));
if (is_array($params) && !empty($params))
{
$params = array_merge(array(
'controller' => $route,
), $params);
}
else if (is_string($params) && $params)
{
$params = 'controller=' . $route . (($is_amp) ? '&' : '&') . $params;
}
else
{
$params = array('controller' => $route);
}
return append_sid($this->phpbb_root_path . 'app' . $this->php_ext, $params, $is_amp, $session_id);
}
/**