mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[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:
parent
cd697e6812
commit
ff9a0e4ef4
1 changed files with 21 additions and 3 deletions
|
@ -88,11 +88,29 @@ class phpbb_controller_helper
|
||||||
* Generate a URL
|
* Generate a URL
|
||||||
*
|
*
|
||||||
* @param string $route The route to travel
|
* @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()
|
* @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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue