@@ -38,7 +38,7 @@ Let's see it in action::
38
38
// framework/index.php
39
39
require_once __DIR__.'/init.php';
40
40
41
- $name = $request->attributes ->get('name', 'World');
41
+ $name = $request->query ->get('name', 'World');
42
42
43
43
$response->setContent(sprintf('Hello %s', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')));
44
44
$response->send();
@@ -98,7 +98,7 @@ Such a script might look like the following::
98
98
And here is for instance the new ``hello.php `` script::
99
99
100
100
// framework/hello.php
101
- $name = $request->attributes ->get('name', 'World');
101
+ $name = $request->query ->get('name', 'World');
102
102
$response->setContent(sprintf('Hello %s', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')));
103
103
104
104
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:
190
190
.. code-block :: html+php
191
191
192
192
<!-- example.com/src/pages/hello.php -->
193
- <?php $name = $request->attributes ->get('name', 'World') ?>
193
+ <?php $name = $request->query ->get('name', 'World') ?>
194
194
195
195
Hello <?= htmlspecialchars($name, ENT_QUOTES, 'UTF-8') ?>
196
196
0 commit comments