Skip to content

Commit d340895

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: [HttpFoundation] replace attributes with query
2 parents 7569cf4 + 9f2b262 commit d340895

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

create_framework/front_controller.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Let's see it in action::
3838
// framework/index.php
3939
require_once __DIR__.'/init.php';
4040

41-
$name = $request->attributes->get('name', 'World');
41+
$name = $request->query->get('name', 'World');
4242

4343
$response->setContent(sprintf('Hello %s', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')));
4444
$response->send();
@@ -98,7 +98,7 @@ Such a script might look like the following::
9898
And here is for instance the new ``hello.php`` script::
9999

100100
// framework/hello.php
101-
$name = $request->attributes->get('name', 'World');
101+
$name = $request->query->get('name', 'World');
102102
$response->setContent(sprintf('Hello %s', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')));
103103

104104
In the ``front.php`` script, ``$map`` associates URL paths with their
@@ -190,7 +190,7 @@ And the ``hello.php`` script can now be converted to a template:
190190
.. code-block:: html+php
191191

192192
<!-- example.com/src/pages/hello.php -->
193-
<?php $name = $request->attributes->get('name', 'World') ?>
193+
<?php $name = $request->query->get('name', 'World') ?>
194194

195195
Hello <?= htmlspecialchars($name, ENT_QUOTES, 'UTF-8') ?>
196196

create_framework/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Now, let's rewrite our application by using the ``Request`` and the
141141

142142
$request = Request::createFromGlobals();
143143

144-
$name = $request->attributes->get('name', 'World');
144+
$name = $request->query->get('name', 'World');
145145

146146
$response = new Response(sprintf('Hello %s', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')));
147147

0 commit comments

Comments
 (0)