Pārlūkot izejas kodu

merged hhamon/controller_getrequest_method

Fabien Potencier 14 gadi atpakaļ
vecāks
revīzija
aaf1300a20

+ 10 - 0
src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

@@ -138,6 +138,16 @@ class Controller extends ContainerAware
         return $this->get('form.factory')->createBuilder('form', $data, $options);
     }
 
+    /**
+     * Shortcut to return the request service.
+     *
+     * @return Symfony\Component\HttpFoundation\Request
+     */
+    public function getRequest()
+    {
+        return $this->get('request');
+    }
+
     /**
      * Shortcut to return the Doctrine Registry service.
      *