Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecate the Request::get() method#15610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:5.4fromjaviereguiluz:fix_15590
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionscreate_framework/front_controller.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,7 +38,7 @@ Let's see it in action::
// framework/index.php
require_once __DIR__.'/init.php';

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

$response->setContent(sprintf('Hello %s', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')));
$response->send();
Expand DownExpand 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->get('name', 'World');
$name = $request->attributes->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 DownExpand 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->get('name', 'World') ?>
<?php $name = $request->attributes->get('name', 'World') ?>

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

Expand Down
2 changes: 1 addition & 1 deletioncreate_framework/http_foundation.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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->get('name', 'World');
$name = $request->attributes->get('name', 'World');

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

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp