Adding Request::getController
authorTim Düsterhus <timwolla@arcor.de>
Tue, 29 Nov 2011 16:42:32 +0000 (17:42 +0100)
committerTim Düsterhus <timwolla@arcor.de>
Tue, 29 Nov 2011 16:42:32 +0000 (17:42 +0100)
It returns the active page|form|action.

wcfsetup/install/files/lib/system/request/Request.class.php

index a14a42e613a04c4095cb6cd4624afc194ba676ae..ae6454db5f7d46d4aae30a3b3831c35176c000ec 100644 (file)
@@ -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;
+       }
 }