Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cdd6dc

Browse files
committed
[#6438] some tweaks to the argument value resolver
1 parent a01f87f commit 2cdd6dc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cookbook/controller/argument_value_resolver.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Symfony ships with four value resolvers in the HttpKernel component:
4444
Adding a Custom Value Resolver
4545
------------------------------
4646

47-
Adding a new value resolver requires creatign one class and one service
47+
Adding a new value resolver requires creating one class and one service
4848
definition. In the next example, you'll create a value resolver to inject the
4949
``User`` object from the security system. Given you write the following
5050
controller::
@@ -189,13 +189,13 @@ subrequests.
189189

190190
.. tip::
191191

192-
As you see in the ``UserValueResolver::supports()`` method, the user may
193-
not be available (e.g. when the controller is not behind a firewall). In
194-
these cases, the resolver will not be executed. If no argument value is
195-
resolved, an exception will be throwed.
192+
As you can see in the ``UserValueResolver::supports()`` method, the user
193+
may not be available (e.g. when the controller is not behind a firewall).
194+
In these cases, the resolver will not be executed. If no argument value
195+
is resolved, an exception will be thrown.
196196

197197
To prevent this, you can add a default value in the controller (e.g. ``User
198-
$user = null``). The ``DefaultValueResolver`` is executed as last resolver
199-
and will use the default value if no value is resolved already.
198+
$user = null``). The ``DefaultValueResolver`` is executed as the last
199+
resolver and will use the default value if no value was already resolved.
200200

201201
.. _`yield`: http://php.net/manual/en/language.generators.syntax.php

0 commit comments

Comments
 (0)