@@ -38,7 +38,14 @@ variables with
38
38
which is almost equivalent to the more verbose, but also more flexible,
39
39
:method: `Symfony\\ Component\\ HttpFoundation\\ Request::__construct ` call::
40
40
41
- $request = new Request($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
41
+ $request = new Request(
42
+ $_GET,
43
+ $_POST,
44
+ array(),
45
+ $_COOKIE,
46
+ $_FILES,
47
+ $_SERVER
48
+ );
42
49
43
50
Accessing Request Data
44
51
~~~~~~~~~~~~~~~~~~~~~~
@@ -184,7 +191,11 @@ Simulating a Request
184
191
Instead of creating a Request based on the PHP globals, you can also simulate
185
192
a Request::
186
193
187
- $request = Request::create('/hello-world', 'GET', array('name' => 'Fabien'));
194
+ $request = Request::create(
195
+ '/hello-world',
196
+ 'GET',
197
+ array('name' => 'Fabien')
198
+ );
188
199
189
200
The :method: `Symfony\\ Component\\ HttpFoundation\\ Request::create ` method
190
201
creates a request based on a path info, a method and some parameters (the
@@ -245,7 +256,11 @@ code, and an array of HTTP headers::
245
256
246
257
use Symfony\Component\HttpFoundation\Response;
247
258
248
- $response = new Response('Content', 200, array('content-type' => 'text/html'));
259
+ $response = new Response(
260
+ 'Content',
261
+ 200,
262
+ array('content-type' => 'text/html')
263
+ );
249
264
250
265
These information can also be manipulated after the Response object creation::
251
266
@@ -358,7 +373,7 @@ Any type of response can be created via the
358
373
right content and headers. A JSON response might look like this::
359
374
360
375
use Symfony\Component\HttpFoundation\Response;
361
-
376
+
362
377
$response = new Response();
363
378
$response->setContent(json_encode(array(
364
379
'data' => 123
@@ -371,4 +386,4 @@ Session
371
386
TBD -- This part has not been written yet as it will probably be refactored
372
387
soon in Symfony 2.1.
373
388
374
- .. _Packagist : https://packagist.org/packages/symfony/http-foundation
389
+ .. _Packagist : https://packagist.org/packages/symfony/http-foundation
0 commit comments