symfony-docs icon indicating copy to clipboard operation
symfony-docs copied to clipboard

Update bundle page to reflect best practices #15881

Open BafS opened this issue 4 years ago • 3 comments

Fix documentation to reflect best practices page: https://symfony.com/doc/5.4/bundles/best_practices.html#directory-structure

See: #15881

BafS avatar Jan 12 '22 11:01 BafS

Hey!

Oh no, it looks like you have made this PR towards a branch that is not maintained anymore. :/ Could you update the PR base branch to target one of these branches instead? 4.4, 5.3, 5.4, 6.0, 6.1.

Cheers!

Carsonbot

carsonbot avatar Jan 12 '22 11:01 carsonbot

It appears that the recommended bundle directory structure does not work by default: https://github.com/symfony/symfony-docs/issues/15881

Perhaps the extra steps needed to make it work also needs to be documented.

Additionally, many (most?) Symfony bundles use the old directory structure.

gnito-org avatar Jan 13 '22 00:01 gnito-org

It appears that the recommended bundle directory structure does not work by default: #15881

Perhaps the extra steps needed to make it work also needs to be documented.

I'd say add the one extra step needed to https://github.com/BafS/symfony-docs/blob/patch-9/bundles.rst#creating-a-bundle - specifically, you need to override the getPath() method:

    public function getPath(): string
    {
        return \dirname(__DIR__);
    }

Additionally, many (most?) Symfony bundles use the old directory structure.

The bundles in the Symfony monorepo probably will never change unless the framework forces a change. In the ecosystem, I imagine between this stuff being documented and Symfony 3.4 support being dropped, it might get some more uptake.

mbabker avatar Mar 07 '22 15:03 mbabker

Closing because this article was updated a while ago ... and we're updating the remaining articles to always prioritize the new dir structure and the AbstractBundle class. See #19793

Thanks!

javiereguiluz avatar Apr 16 '24 15:04 javiereguiluz