-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Inconsistent documentation regarding bundle directory structure #15881
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
Comments
I think we need to update the second article to match the structure of the best practices article. |
You need Symfony 5 for the new structure to work. Also, you need to edit |
Thanks, this is almost working for me now. I'm not sure how to reference the bundles when loading routes, though, as it fails with the new structure. # /config/routes/my_bundle_base.yaml
my_company_base_bundle_oauth:
resource: '@MyCompanyBaseBundle/Controller/OAuthController.php'
prefix: /
type: annotation Curiously, the src/Controller directory didn't move (unlike views=>templates and config). Services seem normal (and work with the "traditional" bundle structure. <service id="MyCompany\BaseBundle\Controller\OAuthController" public="true" autowire="true">
<tag name="container.service_subscriber" />
<tag name="controller.service_arguments" />
</service> Is there a way to list the path resources? I'm trying to follow the FileLoader and YamlFileLoader, but having trouble figuring out where the map comes from to get from @whatever to an realPath. |
Can anyone point me to a bundle that uses the best practices and the new directory structure? I'm really having a hard time trying to figure out how to reference the controller path. @weaverryan , do you think you'll update your excellent SymfonyCast tutorial on how to make a reusable bundle? Especially now that recipes are now much easier to publish since Flex is serverless. (At least that's how I'm readying it.) Thx. |
What is the consensus for new bundles structure? I like the way https://github.com/symfony/panther is structured. https://github.com/symfony/mercure-bundle or https://github.com/symfony/webpack-encore-bundle also use "src/", I feel it's the new convention, it would be great to have the documentation reflect it. |
Hello, Is there finally a consensus, the PR is still not merged ? |
Unfortunately it didn't move, I personally went for https://symfony.com/doc/current/bundles/best_practices.html#directory-structure because I prefer to have my sources in |
I agree with you about src/ & config/ folders. Thank you for your reply 👍 |
Some new UX bundles are also using the |
Yea, we should normalize that - someone else started with some packages NOT using |
I created an issue to track this @weaverryan. And I didn't realized but the docs got updated 4 months ago in #16801, both pages now use |
I also think we can close this issue |
There is an inconsistency between best practices and bundles documentation regarding the directory structure
https://symfony.com/doc/5.4/bundles/best_practices.html#directory-structure
https://symfony.com/doc/current/bundles.html#bundle-directory-structure
I would LOVE to use the new directory structure, get rid of the Resources level directory and use config, templates and public, just like the main application. But I've never been able to get that to work. If there's a setting somewhere to use the Best Practices directory structure (skip the /Resources), can that be documented?
The text was updated successfully, but these errors were encountered: