Skip to content

Update forwarding.rst #18092

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2023
Merged
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
4 changes: 2 additions & 2 deletions controller/forwarding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and calls the defined controller. The ``forward()`` method returns the
:class:`Symfony\\Component\\HttpFoundation\\Response` object that is returned
from *that* controller::

public function index($name)
public function index($name): Response
{
$response = $this->forward('App\Controller\OtherController::fancy', [
'name' => $name,
Expand All @@ -29,7 +29,7 @@ from *that* controller::
The array passed to the method becomes the arguments for the resulting controller.
The target controller method might look something like this::

public function fancy($name, $color)
public function fancy(string $name, string $color): Response
{
// ... create and return a Response object
}
Expand Down