@@ -127,16 +127,9 @@ your ``composer.json`` file to load from there:
127
127
}
128
128
}
129
129
130
- Now, suppose you want to use Twig and load routes via annotations. For annotation
131
- routing, you need SensioFrameworkExtraBundle. This comes with a normal Symfony project.
132
- But in this case, you need to download it:
133
-
134
- .. code-block :: bash
135
-
136
- $ composer require sensio/framework-extra-bundle
137
-
138
- Instead of putting *everything * in ``index.php ``, create a new ``app/AppKernel.php ``
139
- to hold the kernel. Now it looks like this::
130
+ Now, suppose you want to use Twig and load routes via annotations. Instead of
131
+ putting *everything * in ``index.php ``, create a new ``app/AppKernel.php `` to
132
+ hold the kernel. Now it looks like this::
140
133
141
134
// app/AppKernel.php
142
135
@@ -161,7 +154,6 @@ to hold the kernel. Now it looks like this::
161
154
$bundles = array(
162
155
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
163
156
new Symfony\Bundle\TwigBundle\TwigBundle(),
164
- new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle()
165
157
);
166
158
167
159
if ($this->getEnvironment() == 'dev') {
@@ -209,6 +201,12 @@ to hold the kernel. Now it looks like this::
209
201
}
210
202
}
211
203
204
+
205
+ .. versionadded :: 3.4
206
+ Support for annotation routing without an external bundle was added in
207
+ Symfony 3.4. Prior to version 3.4, you needed to install the
208
+ SensioFrameworkExtraBundle.
209
+
212
210
Unlike the previous kernel, this loads an external ``app/config/config.yml `` file,
213
211
because the configuration started to get bigger:
214
212
@@ -261,7 +259,7 @@ has one file in it::
261
259
namespace App\Controller;
262
260
263
261
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
264
- use Sensio\Bundle\FrameworkExtraBundle\Configuration \Route;
262
+ use Symfony\Component\Routing\Annotation \Route;
265
263
266
264
class MicroController extends Controller
267
265
{
0 commit comments