Skip to content
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

Overriding 3rd party bundles #5290

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 7 additions & 0 deletions best_practices/creating-the-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ Symfony documentation uses the AppBundle name.
There is no need to prefix the AppBundle with your own vendor (e.g.
AcmeAppBundle), because this application bundle is never going to be
shared.

.. note::

Another reason to create a new bundle is when you're overriding something
in a vendor's bundle. For instance, if you have to override an action of
the FOSUserBundle, then you should create a UserBundle that would be used
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using a different example than FOSUserBundle. Once I finally release its 2.0 version, people would generally not need to overwrite our actions, because we provide lots of extension points in them. And overwriting FOSUserBundle 2 actions is the worse way to change the behavior.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took out the example here in sha: c24862b, but we still have it in the linked doc. I don't think it's a huge deal, but if we can think of an easy other example, that'd be cool.

And btw - this is an awesome problem to have 👍. I hate overriding bundle controllers - it's almost always a problem when upgrading. So, I like the FOSU events a lot

only for this purpose.

All in all, this is the typical directory structure of a Symfony application
that follows these best practices:
Expand Down