diff --git a/cookbook/bundles/override.rst b/cookbook/bundles/override.rst index 736c72ffa64..70ba6786dde 100644 --- a/cookbook/bundles/override.rst +++ b/cookbook/bundles/override.rst @@ -23,7 +23,7 @@ the routes from any bundle, then they must be manually imported from somewhere in your application (e.g. ``app/config/routing.yml``). The easiest way to "override" a bundle's routing is to never import it at -all. Instead of importing a third-party bundle's routing, simply copying +all. Instead of importing a third-party bundle's routing, simply copy that routing file into your application, modify it, and import it instead. Controllers @@ -68,7 +68,7 @@ in the core FrameworkBundle: $container->setParameter('translator.class', 'Acme\HelloBundle\Translation\Translator'); Secondly, if the class is not available as a parameter, you want to make sure the -class is always overridden when your bundle is used, or you need to modify +class is always overridden when your bundle is used or if you need to modify something beyond just the class name, you should use a compiler pass:: // src/Acme/DemoBundle/DependencyInjection/Compiler/OverrideServiceCompilerPass.php @@ -106,7 +106,7 @@ Forms ----- In order to override a form type, it has to be registered as a service (meaning -it is tagged as "form.type"). You can then override it as you would override any +it is tagged as ``form.type``). You can then override it as you would override any service as explained in `Services & Configuration`_. This, of course, will only work if the type is referred to by its alias rather than being instantiated, e.g.:: @@ -136,7 +136,7 @@ the constraints to a new validation group: .. code-block:: yaml # src/Acme/UserBundle/Resources/config/validation.yml - Fos\UserBundle\Model\User: + FOS\UserBundle\Model\User: properties: plainPassword: - NotBlank: @@ -152,10 +152,17 @@ the constraints to a new validation group: + xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping + http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> + + + + + + - -