8000 [DI] Documenting Abstract Bundle and Extension by yceruto · Pull Request #16801 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[DI] Documenting Abstract Bundle and Extension #16801

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

Merged
merged 9 commits into from
May 27, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove note after update the feature
  • Loading branch information
yceruto committed May 21, 2022
commit d0cba728ea1aae3302192c3f487ca90f42e37d99
15 changes: 1 addition & 14 deletions bundles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,7 @@ called ``AcmeTestBundle.php``::
also choose to shorten the name of the bundle to simply TestBundle by naming
this class TestBundle (and naming the file ``TestBundle.php``).

It's recommended to place your bundle class in the ``src/`` directory and keep out all the
configuration files, templates, translations, etc. By default, Symfony determines the bundle path from the
directory where the bundle class is placed, so you have to define the :method:`Symfony\\Component\\HttpKernel\\Bundle\\Bundle::getPath`
method to tell Symfony what is the root directory of your bundle path::

class AcmeTestBundle extends AbstractBundle
{
public function getPath(): string
{
return \dirname(__DIR__); // returns /path/to/Acme/TestBundle/
}
}

This almost empty class is the only piece you need to create the new bundle. Though
This empty class is the only piece you need to create the new bundle. Though
commonly empty, this class is powerful and can be used to customize the behavior
of the bundle. Now that you've created the bundle, enable it::

Expand Down
0