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

Commit0f13ce9

Browse files
javiereguiluzweaverryan
authored andcommitted
[quick_tour] rewording and grammar fixes suggested by@weaverryan
1 parent7c0037e commit0f13ce9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

‎quick_tour/the_controller.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,30 +83,33 @@ The ``generateUrl()`` is the same method as the ``path()`` function used in the
8383
templates. It takes the route name and an array of parameters as arguments and
8484
returns the associated friendly URL.
8585

86-
You can alsoforwardinternally the action to anotherone with the ``forward()``
86+
You can also internallyforwardthe action to anotherusing the ``forward()``
8787
method::
8888

89-
return $this->forward('AcmeDemoBundle:Hello:fancy', array('name' => $name, 'color' => 'green'));
89+
return $this->forward('AcmeDemoBundle:Hello:fancy', array(
90+
'name' => $name,
91+
'color' => 'green'
92+
));
9093

9194
Displaying Error Pages
9295
----------------------
9396

9497
Errors will inevitably happen during the execution of every web application.
9598
In the case of ``404`` errors, Symfony includes a handy shortcut that you can
96-
useon your controllers::
99+
usein your controllers::
97100

98101
throw $this->createNotFoundException();
99102

100103
For ``500`` errors, just throw a regular PHP exception inside the controller and
101-
Symfony will transform itin a proper ``500`` error page::
104+
Symfony will transform itinto a proper ``500`` error page::
102105

103106
throw new \Exception('Something went wrong!');
104107

105108
Getting information from the Request
106109
------------------------------------
107110

108-
Symfony automatically injects the ``Request`` object when the controllerdefines
109-
a variable type hinted with `Symfony\Component\HttpFoundation\Request`::
111+
Symfony automatically injects the ``Request`` object when the controllerhas an
112+
argument that's type hinted with``Symfony\Component\HttpFoundation\Request`::
110113

111114
use Symfony\Component\HttpFoundation\Request;
112115

@@ -158,8 +161,8 @@ from any controller::
158161
}
159162

160163
You can also store "flash messages" that will auto-delete after the next request.
161-
They are usefulfor instancewhen you need to set a success message before
162-
redirecting theuser to another page (which will then show the message)::
164+
They are useful when you need to set a success message before redirecting the
165+
user to another page (which will then show the message)::
163166

164167
// store a message for the very next request (in a controller)
165168
$session->getFlashBag()->add('notice', 'Congratulations, your action succeeded!');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp