Skip to content

Overriding Default FOSUserBundle Controllers #2034

@yceruto

Description

@yceruto

This lines in the documentation cause a curious confusion:

// src/AppBundle/AcmeUserBundle.php

namespace AppBundle;

//...

Both, the file name as the namespace suggest the reader to create a class AcmeUserBundle.php within the current bundle AppBundle even though the text is explicit:

The first step to overriding a controller in the bundle is to create a child bundle whose parent is FOSUserBundle...

Maybe that lines can be change to improve the understanding of the code:

// src/Acme/UserBundle/AcmeUserBundle.php

namespace Acme\UserBundle;

Well as in another example (Overriding Default FOSUserBundle Templates).

If they agree I can create a PR to fix it.

...I say curious because for my surprise, it was possible to do it within the same existing bundle AppBundle:

//AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            //...
            // app
            new AppBundle\AppBundle(),
            new AppBundle\UserBundle(), //\o/, although I'm not entirely sure this worked.
        );
        //...
    }
    //...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions