@@ -40,18 +40,18 @@ Creating a Bundle
40
40
-----------------
41
41
42
42
This section creates and enables a new bundle to show there are only a few steps required.
43
- The new bundle is called AcmeTestBundle , where the ``Acme `` portion is an example
43
+ The new bundle is called AcmeBlogBundle , where the ``Acme `` portion is an example
44
44
name that should be replaced by some "vendor" name that represents you or your
45
- organization (e.g. AbcTestBundle for some company named ``Abc ``).
45
+ organization (e.g. AbcBlogBundle for some company named ``Abc ``).
46
46
47
- Start by creating a new class called ``AcmeTestBundle ``::
47
+ Start by creating a new class called ``AcmeBlogBundle ``::
48
48
49
- // src/AcmeTestBundle .php
50
- namespace Acme\TestBundle ;
49
+ // src/AcmeBlogBundle .php
50
+ namespace Acme\BlogBundle ;
51
51
52
52
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
53
53
54
- class AcmeTestBundle extends AbstractBundle
54
+ class AcmeBlogBundle extends AbstractBundle
55
55
{
56
56
}
57
57
@@ -67,10 +67,10 @@ Start by creating a new class called ``AcmeTestBundle``::
67
67
68
68
.. tip ::
69
69
70
- The name AcmeTestBundle follows the standard
70
+ The name AcmeBlogBundle follows the standard
71
71
:ref: `Bundle naming conventions <bundles-naming-conventions >`. You could
72
- also choose to shorten the name of the bundle to simply TestBundle by naming
73
- this class TestBundle (and naming the file ``TestBundle .php ``).
72
+ also choose to shorten the name of the bundle to simply BlogBundle by naming
73
+ this class BlogBundle (and naming the file ``BlogBundle .php ``).
74
74
75
75
This empty class is the only piece you need to create the new bundle. Though
76
76
commonly empty, this class is powerful and can be used to customize the behavior
@@ -79,10 +79,10 @@ of the bundle. Now that you've created the bundle, enable it::
79
79
// config/bundles.php
80
80
return [
81
81
// ...
82
- Acme\TestBundle\AcmeTestBundle ::class => ['all' => true],
82
+ Acme\BlogBundle\AcmeBlogBundle ::class => ['all' => true],
83
83
];
84
84
85
- And while it doesn't do anything yet, AcmeTestBundle is now ready to be used.
85
+ And while it doesn't do anything yet, AcmeBlogBundle is now ready to be used.
86
86
87
87
Bundle Directory Structure
88
88
--------------------------
@@ -101,7 +101,7 @@ to be adjusted if needed:
101
101
Holds templates organized by controller name (e.g. ``random/index.html.twig ``).
102
102
103
103
``translations/ ``
104
- Holds translations organized by domain and locale (e.g. ``AcmeTestBundle .en.xlf ``).
104
+ Holds translations organized by domain and locale (e.g. ``AcmeBlogBundle .en.xlf ``).
105
105
106
106
``public/ ``
107
107
Contains web assets (images, compiled CSS and JavaScript files, etc.) and is
@@ -126,7 +126,7 @@ to be adjusted if needed:
126
126
new structure. Override the ``Bundle::getPath() `` method to change to
127
127
the old structure::
128
128
129
- class AcmeTestBundle extends AbstractBundle
129
+ class AcmeBlogBundle extends AbstractBundle
130
130
{
131
131
public function getPath(): string
132
132
{
@@ -145,12 +145,12 @@ to be adjusted if needed:
145
145
{
146
146
"autoload" : {
147
147
"psr-4" : {
148
- "Acme\\ TestBundle \\ " : " src/"
148
+ "Acme\\ BlogBundle \\ " : " src/"
149
149
}
150
150
},
151
151
"autoload-dev" : {
152
152
"psr-4" : {
153
- "Acme\\ TestBundle \\ Tests\\ " : " tests/"
153
+ "Acme\\ BlogBundle \\ Tests\\ " : " tests/"
154
154
}
155
155
}
156
156
}
0 commit comments