소스 검색

merged hhamon/controller_getrequest_method

Fabien Potencier 14 년 전
부모
커밋
aaf1300a20
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

+ 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.
      *