Skip to content

Commit 8e896e6

Browse files
committed
Reworded everything
1 parent ee942d9 commit 8e896e6

File tree

1 file changed

+65
-41
lines changed

1 file changed

+65
-41
lines changed

cookbook/assetic/asset_management.rst

+65-41
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,90 @@
44
How to Use Assetic for Asset Management
55
=======================================
66

7-
.. caution::
7+
Installing and Enabling Assetic
8+
-------------------------------
89

9-
Starting from Symfony 2.8, Assetic is no longer included by default in the
10-
Symfony Standard Edition. Before using any of its features, install the
11-
AsseticBundle executing this console command in your project:
10+
Starting from Symfony 2.8, Assetic is no longer included by default in the
11+
Symfony Standard Edition. Before using any of its features, install the
12+
AsseticBundle executing this console command in your project:
1213

1314
.. code-block:: bash
1415
1516
$ composer require symfony/assetic-bundle
1617
17-
Then, enable the bundle by adding the following configuration under the
18-
``asetic`` key:
18+
Then, enable the bundle in the ``AppKernel`` file of your Symfony application::
1919

20-
.. configuration-block::
20+
// app/AppKernel.php
2121

22-
.. code-block:: yaml
22+
// ...
23+
class AppKernel extends Kernel
24+
{
25+
// ...
2326

24-
# app/config/config.yml
25-
assetic:
26-
debug: "%kernel.debug%"
27-
use_controller: false
28-
filters:
29-
cssrewrite: ~
27+
public function registerBundles()
28+
{
29+
$bundles = array(
30+
// ...
31+
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
32+
);
3033

31-
# ...
34+
// ...
35+
}
36+
}
3237

33-
.. code-block:: xml
38+
Finally, add the following minimal configuration to enable Assetic support in
39+
your application:
3440

35-
<!-- app/config/config.xml -->
36-
<?xml version="1.0" encoding="UTF-8" ?>
37-
<container xmlns="http://symfony.com/schema/dic/services"
38-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
39-
xmlns:framework="http://symfony.com/schema/dic/symfony"
40-
xmlns:twig="http://symfony.com/schema/dic/twig"
41-
xsi:schemaLocation="http://symfony.com/schema/dic/services
42-
http://symfony.com/schema/dic/services/services-1.0.xsd
43-
http://symfony.com/schema/dic/symfony
44-
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
41+
.. configuration-block::
4542

46-
<assetic:config debug="%kernel.debug%" use-controller="%kernel.debug%">
47-
<assetic:filters cssrewrite="null" />
48-
</assetic:config>
43+
.. code-block:: yaml
4944
50-
<!-- ... -->
51-
</container>
45+
# app/config/config.yml
46+
assetic:
47+
debug: "%kernel.debug%"
48+
use_controller: false
49+
filters:
50+
cssrewrite: ~
5251
53-
.. code-block:: php
52+
# ...
5453
55-
// app/config/config.php
54+
.. code-block:: xml
5655
57-
$container->loadFromExtension('assetic', array(
58-
'debug' => '%kernel.debug%',
59-
'use_controller' => '%kernel.debug%',
60-
'filters' => array(
61-
'cssrewrite' => null,
62-
),
63-
// ...
64-
));
56+
<!-- app/config/config.xml -->
57+
<?xml version="1.0" encoding="UTF-8" ?>
58+
<container xmlns="http://symfony.com/schema/dic/services"
59+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
60+
xmlns:framework="http://symfony.com/schema/dic/symfony"
61+
xmlns:twig="http://symfony.com/schema/dic/twig"
62+
xsi:schemaLocation="http://symfony.com/schema/dic/services
63+
http://symfony.com/schema/dic/services/services-1.0.xsd
64+
http://symfony.com/schema/dic/symfony
65+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
66+
67+
<assetic:config debug="%kernel.debug%" use-controller="%kernel.debug%">
68+
<assetic:filters cssrewrite="null" />
69+
</assetic:config>
70+
71+
<!-- ... -->
72+
</container>
73+
74+
.. code-block:: php
75+
76+
// app/config/config.php
6577
78+
$container->loadFromExtension('assetic', array(
79+
'debug' => '%kernel.debug%',
80+
'use_controller' => '%kernel.debug%',
81+
'filters' => array(
82+
'cssrewrite' => null,
83+
),
6684
// ...
85+
));
86+
87+
// ...
88+
89+
Introducing Assetic
90+
-------------------
6791

6892
Assetic combines two major ideas: :ref:`assets <cookbook-assetic-assets>` and
6993
:ref:`filters <cookbook-assetic-filters>`. The assets are files such as CSS,

0 commit comments

Comments
 (0)