Skip to content

Commit cc5564e

Browse files
committed
Update override.rst
| Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets |
1 parent 236c26f commit cc5564e

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

cookbook/bundles/override.rst

+14-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ the routes from any bundle, then they must be manually imported from somewhere
2323
in your application (e.g. ``app/config/routing.yml``).
2424

2525
The easiest way to "override" a bundle's routing is to never import it at
26-
all. Instead of importing a third-party bundle's routing, simply copying
26+
all. Instead of importing a third-party bundle's routing, simply copy
2727
that routing file into your application, modify it, and import it instead.
2828

2929
Controllers
@@ -68,7 +68,7 @@ in the core FrameworkBundle:
6868
$container->setParameter('translator.class', 'Acme\HelloBundle\Translation\Translator');
6969
7070
Secondly, if the class is not available as a parameter, you want to make sure the
71-
class is always overridden when your bundle is used, or you need to modify
71+
class is always overridden when your bundle is used, or if you need to modify
7272
something beyond just the class name, you should use a compiler pass::
7373

7474
// src/Acme/DemoBundle/DependencyInjection/Compiler/OverrideServiceCompilerPass.php
@@ -106,7 +106,7 @@ Forms
106106
-----
107107

108108
In order to override a form type, it has to be registered as a service (meaning
109-
it is tagged as "form.type"). You can then override it as you would override any
109+
it is tagged as ``form.type``). You can then override it as you would override any
110110
service as explained in `Services & Configuration`_. This, of course, will only
111111
work if the type is referred to by its alias rather than being instantiated,
112112
e.g.::
@@ -136,7 +136,7 @@ the constraints to a new validation group:
136136
.. code-block:: yaml
137137
138138
# src/Acme/UserBundle/Resources/config/validation.yml
139-
Fos\UserBundle\Model\User:
139+
FOS\UserBundle\Model\User:
140140
properties:
141141
plainPassword:
142142
- NotBlank:
@@ -152,10 +152,17 @@ the constraints to a new validation group:
152152
<?xml version="1.0" encoding="UTF-8" ?>
153153
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
154154
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
155-
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
155+
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping
156+
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
157+
158+
<class name="FOS\UserBundle\Model\User">
159+
<property name="plainPassword">
160+
<constraint name="NotBlank">
161+
<option name="groups">
162+
<value>AcmeValidation</value>
163+
</option>
164+
</constraint>
156165
157-
<class name="Fos\UserBundle\Model\User">
158-
<property name="password">
159166
<constraint name="Length">
160167
<option name="min">6</option>
161168
<option name="minMessage">fos_user.password.short</option>

0 commit comments

Comments
 (0)