Skip to content

Commit

Permalink
Merge pull request #1549 from WouterJ/clearify_extending_bundles
Browse files Browse the repository at this point in the history
Clearify the goal of Bundle::getParent()
  • Loading branch information
weaverryan committed Jul 14, 2012
2 parents 7487a77 + e58b98c commit cbdf430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cookbook/bundles/inheritance.rst
Expand Up @@ -32,6 +32,11 @@ as the "parent" of your bundle::
By making this simple change, you can now override several parts of the ``FOSUserBundle``
simply by creating a file with the same name.

.. note::

Despite the method name, there is no parent/child relationship between
the bundles, it is just a way to extend and override an existing bundle.

Overriding Controllers
~~~~~~~~~~~~~~~~~~~~~~

Expand Down
8 changes: 4 additions & 4 deletions quick_tour/the_architecture.rst
Expand Up @@ -295,11 +295,11 @@ Extending Bundles

If you follow these conventions, then you can use :doc:`bundle inheritance</cookbook/bundles/inheritance>`
to "override" files, controllers or templates. For example, you can create
a bundle - ``AcmeNewBundle`` - and specify that its parent is ``AcmeDemoBundle``.
a bundle - ``AcmeNewBundle`` - and specify that it overrides ``AcmeDemoBundle``.
When Symfony loads the ``AcmeDemoBundle:Welcome:index`` controller, it will
first look for the ``WelcomeController`` class in ``AcmeNewBundle`` and then
look inside ``AcmeDemoBundle``. This means that one bundle can override almost
any part of another bundle!
first look for the ``WelcomeController`` class in ``AcmeNewBundle`` and, if
not exists, then look inside ``AcmeDemoBundle``. This means that one bundle
can override almost any part of another bundle!

Do you understand now why Symfony2 is so flexible? Share your bundles between
applications, store them locally or globally, your choice.
Expand Down

0 comments on commit cbdf430

Please sign in to comment.