Browse Source

Merge pull request #6855 from cakephp/master-components

Also provide response in components.
Mark Story 10 years ago
parent
commit
c77cdad6f8
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/Controller/Component.php

+ 8 - 0
src/Controller/Component.php

@@ -70,6 +70,13 @@ class Component implements EventListenerInterface
     public $request;
 
     /**
+     * Response object
+     *
+     * @var \Cake\Network\Response
+     */
+    public $response;
+
+    /**
      * Component registry class used to lazy load components.
      *
      * @var \Cake\Controller\ComponentRegistry
@@ -111,6 +118,7 @@ class Component implements EventListenerInterface
         $controller = $registry->getController();
         if ($controller) {
             $this->request =& $controller->request;
+            $this->response =& $controller->response;
         }
 
         $this->config($config);