Permalink
Browse files

minor #4831 Update override.rst (ifdattic)

This PR was merged into the 2.3 branch.

Discussion
----------

Update override.rst

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

Commits
-------

44b1584 Update override.rst
cc5564e Update override.rst
  • Loading branch information...
weaverryan committed Jan 25, 2015
2 parents f9c2d69 + 44b1584 commit 9a6d7b9ec4b1d7e69f163af6bb17dcbc2a02a1f1
Showing with 14 additions and 7 deletions.
  1. +14 −7 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:
<?xml version="1.0" encoding="UTF-8" ?>
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
<class name="FOS\UserBundle\Model\User">
<property name="plainPassword">
<constraint name="NotBlank">
<option name="groups">
<value>AcmeValidation</value>
</option>
</constraint>
<class name="Fos\UserBundle\Model\User">
<property name="password">
<constraint name="Length">
<option name="min">6</option>
<option name="minMessage">fos_user.password.short</option>

0 comments on commit 9a6d7b9

Please sign in to comment.