From: Tim Düsterhus Date: Tue, 29 Nov 2011 16:42:32 +0000 (+0100) Subject: Adding Request::getController X-Git-Tag: 2.0.0_Beta_1~1545^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b610603188e36a27163a4fc9925d41b62d835062;p=GitHub%2FWoltLab%2FWCF.git Adding Request::getController It returns the active page|form|action. --- 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; + } }