Request

参照symfony2的Request服务

  • GET {#get}
  1. public function testAction(Request $request)
  2. {
  3. //get
  4. $request -> query -> get('xxx');
  5. $request -> query -> all();
  6. }
  • POST {#post}
  1. public function testAction(Request $request)
  2. {
  3. //post
  4. $request -> request -> get('xxx');
  5. $request -> request -> all()
  6. }
  • FILE {#file}
  1. public function testAction(Request $request)
  2. {
  3. //file
  4. $request -> file -> get('xxxx');
  5. }