Skip to content

Clearify the goal of Bundle::getParent() #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cookbook/bundles/inheritance.rst
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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