Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e59d351

Browse filesBrowse files
committed
tweaks thanks to WouterJ and javiereguiluz
1 parent 80c637d commit e59d351
Copy full SHA for e59d351

File tree

Expand file treeCollapse file tree

1 file changed

+15
-15
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-15
lines changed

‎cookbook/configuration/micro-kernel-trait.rst

Copy file name to clipboardExpand all lines: cookbook/configuration/micro-kernel-trait.rst
+15-15Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ via Composer:
2525

2626
.. code-block:: bash
2727
28-
composer require symfony/symfony
28+
$ composer require symfony/symfony
2929
3030
Next, create an ``index.php`` file that creates a kernel class and executes it::
3131

@@ -101,12 +101,12 @@ that define your bundles, your services and your routes:
101101

102102
**configureContainer(ContainerBuilder $c, LoaderInterface $loader)**
103103
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
106106
directly in PHP or load external configuration files (shown below).
107107

108108
**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``
110110
is new in Symfony 2.8 and has methods that make adding routes in PHP more fun.
111111
You can also load external routing files (shown below).
112112

@@ -115,31 +115,31 @@ Advanced Example: Twig, Annotations and the Web Debug Toolbar
115115
-------------------------------------------------------------
116116

117117
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.
119119

120120
First, you'll probably want to put your PHP classes in an ``src/`` directory. Configure
121121
your ``composer.json`` file to load from there:
122122

123-
... code-block:: json
123+
.. code-block:: json
124124
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+
}
132133
}
133134
}
134-
}
135135
136136
Now, suppose you want to use Twig and load routes via annotations. For annotation
137137
routing, you need SensioFrameworkExtraBundle. This comes with a normal Symfony project.
138138
But in this case, you need to download it:
139139

140140
.. code-block:: bash
141141
142-
composer require sensio/framework-extra-bundle
142+
$ composer require sensio/framework-extra-bundle
143143
144144
Instead of putting *everything* in ``index.php``, create a new ``app/AppKernel.php``
145145
to hold the kernel. Now it looks like this::

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.