mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[feature/controller] Remove URL Base from helper class
I had forgotten that the container sends the same instance of objects to all services that request it, so in this case all controllers would share the same base url path, which is not desired. PHPBB3-10864
This commit is contained in:
parent
aead33432a
commit
b4eff4f06a
@ -47,12 +47,6 @@ class phpbb_controller_helper
|
||||
*/
|
||||
protected $php_ext;
|
||||
|
||||
/**
|
||||
* Base URL
|
||||
* @var array
|
||||
*/
|
||||
protected $url_base;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -101,21 +95,7 @@ class phpbb_controller_helper
|
||||
*/
|
||||
public function url(array $url_parts, $query = '')
|
||||
{
|
||||
return append_sid($this->root_path . $this->url_base . implode('/', $url_parts), $query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set base to prepend to urls generated by url()
|
||||
* This allows extensions to have a certain 'directory' under which
|
||||
* all their pages are served, but not have to type it every time
|
||||
*
|
||||
* @param array $url_parts Each array element is a 'folder'
|
||||
* i.e. array('my', 'ext') maps to ./app.php/my/ext
|
||||
* @return null
|
||||
*/
|
||||
public function set_url_base(array $url_parts)
|
||||
{
|
||||
$this->url_base = !empty($url_parts) ? implode('/', $url_parts) . '/' : '';
|
||||
return append_sid($this->root_path . implode('/', $url_parts), $query);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user