Skip to content

Bundle controllers extending ContainerAware #4008

Closed
@tgalopin

Description

@tgalopin

Hi everyone!

In the Developer eXperience initiative, @weaverryan suggested that FOSUserBundle controllers should probably extend the Symfony Controller base class (FriendsOfSymfony/FOSUserBundle#1527). But the choice to extend ContainerAware instead of Controller was based on the documentation: http://symfony.com/doc/current/cookbook/bundles/best_practices.html#controllers.

Why is it a best practice to extend ContainerAware instead of Controller? In a bundle, we already are in the context of the framework, so it does not break any dependency and it allows developpers to use shortcuts provided by Controller in their bundles, which is great for beginners, so I don't get why.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions