@@ -25,7 +25,7 @@ via Composer:
25
25
26
26
.. code-block :: bash
27
27
28
- composer require symfony/symfony
28
+ $ composer require symfony/symfony
29
29
30
30
Next, create an ``index.php `` file that creates a kernel class and executes it::
31
31
@@ -101,12 +101,12 @@ that define your bundles, your services and your routes:
101
101
102
102
**configureContainer(ContainerBuilder $c, LoaderInterface $loader) **
103
103
This methods builds and configures the container. In practice, you will use
104
- ``loadFromExtension `` to configure different bundles (this is the equivalent)
105
- of what you see in a normal ``config.yml `` file. You can also register services
104
+ ``loadFromExtension `` to configure different bundles (this is the equivalent
105
+ of what you see in a normal ``config.yml `` file) . You can also register services
106
106
directly in PHP or load external configuration files (shown below).
107
107
108
108
**configureRoutes(RouteCollectionBuilder $routes) **
109
- Your job in this method is to add routes to the system . The ``RouteCollectionBuilder ``
109
+ Your job in this method is to add routes to the application . The ``RouteCollectionBuilder ``
110
110
is new in Symfony 2.8 and has methods that make adding routes in PHP more fun.
111
111
You can also load external routing files (shown below).
112
112
@@ -115,31 +115,31 @@ Advanced Example: Twig, Annotations and the Web Debug Toolbar
115
115
-------------------------------------------------------------
116
116
117
117
The purpose of the ``MicroKernelTrait `` is *not * to have a single-file application.
118
- Instead, it's goal to give you the power to choose your bundles and structure.
118
+ Instead, its goal to give you the power to choose your bundles and structure.
119
119
120
120
First, you'll probably want to put your PHP classes in an ``src/ `` directory. Configure
121
121
your ``composer.json `` file to load from there:
122
122
123
- ... code-block:: json
123
+ .. code-block :: json
124
124
125
- {
126
- "require": {
127
- "...": "...",
128
- },
129
- "autoload": {
130
- "psr-4": {
131
- "": "src/"
125
+ {
126
+ "require" : {
127
+ "..." : " ..."
128
+ },
129
+ "autoload" : {
130
+ "psr-4" : {
131
+ "" : " src/"
132
+ }
132
133
}
133
134
}
134
- }
135
135
136
136
Now, suppose you want to use Twig and load routes via annotations. For annotation
137
137
routing, you need SensioFrameworkExtraBundle. This comes with a normal Symfony project.
138
138
But in this case, you need to download it:
139
139
140
140
.. code-block :: bash
141
141
142
- composer require sensio/framework-extra-bundle
142
+ $ composer require sensio/framework-extra-bundle
143
143
144
144
Instead of putting *everything * in ``index.php ``, create a new ``app/AppKernel.php ``
145
145
to hold the kernel. Now it looks like this::
0 commit comments