From b610603188e36a27163a4fc9925d41b62d835062 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 29 Nov 2011 17:42:32 +0100 Subject: [PATCH] Adding Request::getController It returns the active page|form|action. --- .../files/lib/system/request/Request.class.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/request/Request.class.php b/wcfsetup/install/files/lib/system/request/Request.class.php index a14a42e613..ae6454db5f 100644 --- a/wcfsetup/install/files/lib/system/request/Request.class.php +++ b/wcfsetup/install/files/lib/system/request/Request.class.php @@ -36,6 +36,12 @@ class Request { */ protected $executed = false; + /** + * controller object + * @var object + */ + protected $controller = null; + /** * Creates a new request object. * @@ -55,7 +61,7 @@ class Request { public function execute() { if (!$this->executed) { $this->executed = true; - new $this->className(); + $this->controller = new $this->className(); } } @@ -94,4 +100,13 @@ class Request { public function getPageType() { return $this->pageType; } + + /** + * Returns the controller of this request. + * + * @return object + */ + public function getController() { + return $this->controller; + } } -- 2.20.1