Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions create_framework/front_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Let's see it in action::
// framework/index.php
require_once __DIR__.'/init.php';

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

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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion create_framework/http_foundation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Now, let's rewrite our application by using the ``Request`` and the

$request = Request::createFromGlobals();

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

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

Expand Down