From 17a4d58c1a6227fd8bd31ef3baa56f7bf6744241 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Tue, 10 Jul 2012 17:57:54 +0200 Subject: [PATCH 1/3] Clearify the goal of Bundle::getParent() The method getParent is confusing because there is no parent/child relation. This commit added a note to clearify this --- cookbook/bundles/inheritance.rst | 5 +++++ quick_tour/the_architecture.rst | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cookbook/bundles/inheritance.rst b/cookbook/bundles/inheritance.rst index 15df88c6620..91480a72bb6 100644 --- a/cookbook/bundles/inheritance.rst +++ b/cookbook/bundles/inheritance.rst @@ -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 ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/quick_tour/the_architecture.rst b/quick_tour/the_architecture.rst index 1cbbfc5028f..50a5c5b84c0 100644 --- a/quick_tour/the_architecture.rst +++ b/quick_tour/the_architecture.rst @@ -295,15 +295,20 @@ Extending Bundles If you follow these conventions, then you can use :doc:`bundle 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 it +does 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. +.. 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. + .. _using-vendors: Using Vendors From d9d70b80403cf4c2ceb1e042e645fb38f31c5437 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Tue, 10 Jul 2012 18:01:25 +0200 Subject: [PATCH 2/3] Fixed some grammar --- quick_tour/the_architecture.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quick_tour/the_architecture.rst b/quick_tour/the_architecture.rst index 50a5c5b84c0..cc42f10df69 100644 --- a/quick_tour/the_architecture.rst +++ b/quick_tour/the_architecture.rst @@ -297,8 +297,8 @@ If you follow these conventions, then you can use :doc:`bundle inheritance Date: Tue, 10 Jul 2012 18:13:35 +0200 Subject: [PATCH 3/3] Remove note from the Quick tour because it isn't relevant at that place --- quick_tour/the_architecture.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/quick_tour/the_architecture.rst b/quick_tour/the_architecture.rst index cc42f10df69..fe06a4b7531 100644 --- a/quick_tour/the_architecture.rst +++ b/quick_tour/the_architecture.rst @@ -304,11 +304,6 @@ 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. -.. 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. - .. _using-vendors: Using Vendors