diff options
author | Tristan Darricau <github@nicofuma.fr> | 2014-07-08 00:04:11 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-07-08 00:04:11 +0200 |
commit | 9374d14e275d2ec1317558a7d7ba93ab71a2a4c1 (patch) | |
tree | 65fa5166db2f6f61ebd2db563b0f90d6cf9b304d | |
parent | 7399f29df8f764ff8096620a8f11afae0decc215 (diff) | |
download | forums-9374d14e275d2ec1317558a7d7ba93ab71a2a4c1.tar forums-9374d14e275d2ec1317558a7d7ba93ab71a2a4c1.tar.gz forums-9374d14e275d2ec1317558a7d7ba93ab71a2a4c1.tar.bz2 forums-9374d14e275d2ec1317558a7d7ba93ab71a2a4c1.tar.xz forums-9374d14e275d2ec1317558a7d7ba93ab71a2a4c1.zip |
[ticket/12787] Add controller_helper::get_current_url()
PHPBB3-12787
-rw-r--r-- | phpBB/config/services.yml | 1 | ||||
-rw-r--r-- | phpBB/phpbb/controller/helper.php | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index fdc8aa5870..959d9db01b 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -96,6 +96,7 @@ services: - @config - @controller.provider - @ext.manager + - @symfony_request - %core.root_path% - %core.php_ext% diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php index 930bc42a98..e330fb5b6d 100644 --- a/phpBB/phpbb/controller/helper.php +++ b/phpBB/phpbb/controller/helper.php @@ -40,6 +40,9 @@ class helper */ protected $config; + /* @var \phpbb\symfony_request */ + protected $symfony_request; + /** * phpBB root path * @var string @@ -60,14 +63,16 @@ class helper * @param \phpbb\config\config $config Config object * @param \phpbb\controller\provider $provider Path provider * @param \phpbb\extension\manager $manager Extension manager object + * @param \phpbb\symfony_request $symfony_request Symfony Request object * @param string $phpbb_root_path phpBB root path * @param string $php_ext PHP extension */ - public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, $phpbb_root_path, $php_ext) + public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, $phpbb_root_path, $php_ext) { $this->template = $template; $this->user = $user; $this->config = $config; + $this->symfony_request = $symfony_request; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; $provider->find_routing_files($manager->get_finder()); @@ -151,4 +156,14 @@ class helper return $this->render('message_body.html', $this->user->lang('INFORMATION'), $code); } + + /** + * Return the current url + * + * @return string + */ + public function get_current_url() + { + return generate_board_url(true) . $this->symfony_request->getRequestUri(); + } } |