Skip to content

Commit 24f7fcf

Browse files
javiereguiluzHeahDude
authored andcommitted
minor #13130 Update twig.rst (zairigimad)
This PR was submitted for the 5.0 branch but it was merged into the 3.4 branch instead (closes #13130). Discussion ---------- Update twig.rst Typo ? Commits ------- a7dac72 Update twig.rst
2 parents f739e4b + a7dac72 commit 24f7fcf

12 files changed

+42
-36
lines changed

reference/configuration/twig.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ If set to a string, the template contents are escaped using the strategy with
8080
that name. Allowed values are ``html``, ``js``, ``css``, ``url``, ``html_attr``
8181
and ``name``. The default value is ``name``. This strategy escapes contents
8282
according to the template name extension (e.g. it uses ``html`` for ``*.html.twig``
83-
templates and ``js`` for ``*.js.html`` templates).
83+
templates and ``js`` for ``*.js.twig`` templates).
8484

8585
.. tip::
8686

security/access_control.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ Take the following ``access_control`` entries as an example:
5959
<rule path="^/admin" role="ROLE_USER_HOST" host="symfony\.com$"/>
6060
<rule path="^/admin" role="ROLE_USER_METHOD" methods="POST, PUT"/>
6161
<!-- when defining multiple roles, users must have at least one of them (it's like an OR condition) -->
62-
<rule path="^/admin" roles="ROLE_ADMIN, ROLE_MANAGER"/>
62+
<rule path="^/admin">
63+
<role>ROLE_ADMIN</role>
64+
<role>ROLE_MANAGER</role>
65+
</rule>
6366
</config>
6467
</srv:container>
6568

security/custom_authentication_provider.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ the value returned for the expected WSSE information, creates a token using
172172
that information, and passes the token on to the authentication manager. If
173173
the proper information is not provided, or the authentication manager throws
174174
an :class:`Symfony\\Component\\Security\\Core\\Exception\\AuthenticationException`,
175-
a 403 Response is returned.
175+
a 401 Response is returned.
176176

177177
.. note::
178178

security/entity_provider.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ the username and then check the password (more on passwords in a moment):
246246
<!-- ... -->
247247
248248
<provider name="our_db_provider">
249-
<!-- if you're using multiple entity managers, add:
250-
manager-name="customer" -->
251249
<entity class="AppBundle:User" property="username"/>
250+
<!-- if you're using multiple entity managers -->
251+
<entity class="AppBundle:User" property="username" manager-name="customer"/>
252252
</provider>
253253
254254
<firewall name="main" pattern="^/" provider="our_db_provider">

security/force_https.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ to use HTTPS then you could use the following configuration:
3333
<config>
3434
<!-- ... -->
3535
36-
<rule path="^/secure" role="ROLE_ADMIN" requires_channel="https"/>
36+
<rule path="^/secure" role="ROLE_ADMIN" requires-channel="https"/>
3737
</config>
3838
</srv:container>
3939
@@ -83,7 +83,7 @@ role:
8383
8484
<rule path="^/login"
8585
role="IS_AUTHENTICATED_ANONYMOUSLY"
86-
requires_channel="https"
86+
requires-channel="https"
8787
/>
8888
</config>
8989
</srv:container>

security/guard_authentication.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Next, make sure you've configured a "user provider" for the user:
116116
<!-- ... -->
117117
118118
<provider name="your_db_provider">
119-
<entity class="AppBundle:User"/>
119+
<entity class="AppBundle:User" property="apiKey"/>
120120
</provider>
121121
122122
<!-- ... -->
@@ -133,6 +133,7 @@ Next, make sure you've configured a "user provider" for the user:
133133
'your_db_provider' => [
134134
'entity' => [
135135
'class' => 'AppBundle:User',
136+
'property' => 'apiKey',
136137
],
137138
],
138139
],
@@ -305,9 +306,9 @@ Finally, configure your ``firewalls`` key in ``security.yml`` to use this authen
305306
306307
<firewall name="main"
307308
pattern="^/"
308-
anonymous="true"
309309
>
310-
<logoutOjso/>
310+
<anonymous/>
311+
<logout/>
311312
312313
<guard>
313314
<authenticator>AppBundle\Security\TokenAuthenticator</authenticator>

security/json_login_setup.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ The security configuration should be:
184184
<firewall name="main">
185185
<anonymous/>
186186
<json-login check-path="login"
187-
username-path="security.credentials.login"
188-
password-path="security.credentials.password"/>
187+
username-path="security.credentials.login"
188+
password-path="security.credentials.password"/>
189189
</firewall>
190190
</config>
191191
</srv:container>

security/ldap.rst

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,20 @@ use the ``ldap`` user provider.
152152
153153
<config>
154154
<provider name="my_ldap">
155-
<ldap
156-
service="Symfony\Component\Ldap\Ldap"
157-
base-dn="dc=example,dc=com"
158-
search-dn="cn=read-only-admin,dc=example,dc=com"
159-
search-password="password"
160-
default-roles="ROLE_USER"
161-
uid-key="uid"
155+
<ldap service="Symfony\Component\Ldap\Ldap"
156+
base-dn="dc=example,dc=com"
157+
search-dn="cn=read-only-admin,dc=example,dc=com"
158+
search-password="password"
159+
default-roles="ROLE_USER"
160+
uid-key="uid"
162161
/>
163162
</provider>
164163
</config>
165164
</srv:container>
166165
167166
.. code-block:: php
168167
168+
// app/config/security.php
169169
use Symfony\Component\Ldap\Ldap;
170170
171171
$container->loadFromExtension('security', [
@@ -358,15 +358,15 @@ Configuration example for form login
358358
359359
<config>
360360
<firewall name="main">
361-
<form-login-ldap
362-
service="Symfony\Component\Ldap\Ldap"
363-
dn-string="uid={username},dc=example,dc=com"/>
361+
<form-login-ldap service="Symfony\Component\Ldap\Ldap"
362+
dn-string="uid={username},dc=example,dc=com"/>
364363
</firewall>
365364
</config>
366365
</srv:container>
367366
368367
.. code-block:: php
369368
369+
// app/config/security.php
370370
use Symfony\Component\Ldap\Ldap;
371371
372372
$container->loadFromExtension('security', [
@@ -394,7 +394,7 @@ Configuration example for HTTP Basic
394394
395395
firewalls:
396396
main:
397-
# ...
397+
stateless: true
398398
http_basic_ldap:
399399
# ...
400400
service: Symfony\Component\Ldap\Ldap
@@ -412,13 +412,15 @@ Configuration example for HTTP Basic
412412
413413
<config>
414414
<firewall name="main" stateless="true">
415-
<http-basic-ldap service="Symfony\Component\Ldap\Ldap" dn-string="uid={username},dc=example,dc=com"/>
415+
<http-basic-ldap service="Symfony\Component\Ldap\Ldap"
416+
dn-string="uid={username},dc=example,dc=com"/>
416417
</firewall>
417418
</config>
418419
</srv:container>
419420
420421
.. code-block:: php
421422
423+
// app/config/security.php
422424
use Symfony\Component\Ldap\Ldap;
423425
424426
$container->loadFromExtension('security', [
@@ -466,10 +468,9 @@ Configuration example for form login and query_string
466468
467469
<config>
468470
<firewall name="main">
469-
<form-login-ldap
470-
service="Symfony\Component\Ldap\Ldap"
471-
dn-string="dc=example,dc=com"
472-
query-string="(&amp;(uid={username})(memberOf=cn=users,ou=Services,dc=example,dc=com))"/>
471+
<form-login-ldap service="Symfony\Component\Ldap\Ldap"
472+
dn-string="dc=example,dc=com"
473+
query-string="(&amp;(uid={username})(memberOf=cn=users,ou=Services,dc=example,dc=com))"/>
473474
</firewall>
474475
</config>
475476
</srv:container>

security/multiple_guard_authenticators.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ This is how your security configuration can look in action:
6868
'default' => [
6969
'anonymous' => null,
7070
'guard' => [
71-
'entry_point' => '',
71+
'entry_point' => LoginFormAuthenticator::class,
7272
'authenticators' => [
7373
LoginFormAuthenticator::class,
7474
FacebookConnectAuthenticator::class,

security/multiple_user_providers.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ the first provider is always used:
149149
'pattern' => '^/',
150150
'provider' => 'user_db',
151151
'http_basic' => [
152-
// ...
153152
'realm' => 'Secured Demo Area',
154153
'provider' => 'in_memory',
155154
],

security/remember_me.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ service you just created:
348348
<!-- ... -->
349349
350350
<remember-me
351-
token_provider="Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider"
351+
token-provider="Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider"
352352
/>
353353
</firewall>
354354
</config>
@@ -357,6 +357,8 @@ service you just created:
357357
.. code-block:: php
358358
359359
// app/config/security.php
360+
use Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider;
361+
360362
$container->loadFromExtension('security', [
361363
// ...
362364
@@ -365,7 +367,7 @@ service you just created:
365367
// ...
366368
'remember_me' => [
367369
// ...
368-
'token_provider' => 'Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider',
370+
'token_provider' => DoctrineTokenProvider:class,
369371
],
370372
],
371373
],

security/user_checkers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ is the service id of your user checker:
8989
9090
<config>
9191
<!-- ... -->
92-
<firewall name="main" pattern="^/">
93-
<user-checker>AppBundle\Security\UserChecker</user-checker>
92+
<firewall name="main"
93+
pattern="^/"
94+
user-checker="AppBundle\Security\UserChecker">
9495
<!-- ... -->
9596
</firewall>
9697
</config>
@@ -99,11 +100,10 @@ is the service id of your user checker:
99100
.. code-block:: php
100101
101102
// app/config/security.php
102-
103-
// ...
104103
use AppBundle\Security\UserChecker;
105104
106105
$container->loadFromExtension('security', [
106+
// ...
107107
'firewalls' => [
108108
'main' => [
109109
'pattern' => '^/',

0 commit comments

Comments
 (0)