@@ -38,7 +38,7 @@ Let's see it in action::
3838 // framework/index.php
3939 require_once __DIR__.'/init.php';
4040
41- $name = $request->get('name', 'World');
41+ $name = $request->attributes-> 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::
9898And here is for instance the new ``hello.php `` script::
9999
100100 // framework/hello.php
101- $name = $request->get('name', 'World');
101+ $name = $request->attributes-> get('name', 'World');
102102 $response->setContent(sprintf('Hello %s', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')));
103103
104104In 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->get('name', 'World') ?>
193+ <?php $name = $request->attributes-> get('name', 'World') ?>
194194
195195 Hello <?= htmlspecialchars($name, ENT_QUOTES, 'UTF-8') ?>
196196
0 commit comments