Skip to content

Commit d2e51da

Browse files
committed
Reworded the caution notes about AsseticBundle
1 parent 0764dff commit d2e51da

File tree

9 files changed

+69
-50
lines changed

9 files changed

+69
-50
lines changed

best_practices/web-assets.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ Using Assetic
3838
.. caution::
3939

4040
Starting from Symfony 2.8, Assetic is no longer included by default in the
41-
Symfony Standard Edition. Before using any of its features, install the
42-
AsseticBundle executing this command command in your project:
43-
44-
.. code-block:: cli
45-
46-
$ composer install symfony/assetic-bundle
41+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
42+
to learn how to install and enable Assetic in your Symfony application.
4743

4844
These days, you probably can't simply create static CSS and JavaScript files
4945
and include them in your template. Instead, you'll probably want to combine

cookbook/assetic/apply_to_option.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ How to Apply an Assetic Filter to a specific File Extension
77
.. caution::
88

99
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 command command in your project:
12-
13-
.. code-block:: cli
14-
15-
$ composer install symfony/assetic-bundle
10+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
11+
to learn how to install and enable Assetic in your Symfony application.
1612

1713
Assetic filters can be applied to individual files, groups of files or even,
1814
as you'll see here, files that have a specific extension. To show you how

cookbook/assetic/asset_management.rst

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,60 @@ How to Use Assetic for Asset Management
1010
Symfony Standard Edition. Before using any of its features, install the
1111
AsseticBundle executing this command command in your project:
1212

13-
.. code-block:: cli
13+
.. code-block:: bash
1414
15-
$ composer install symfony/assetic-bundle
15+
$ composer require symfony/assetic-bundle
16+
17+
Then, enable the bundle by adding the following configuration under the
18+
``asetic`` key:
19+
20+
.. configuration-block::
21+
22+
.. code-block:: yaml
23+
24+
# app/config/config.yml
25+
assetic:
26+
debug: "%kernel.debug%"
27+
use_controller: false
28+
filters:
29+
cssrewrite: ~
30+
31+
# ...
32+
33+
.. code-block:: xml
34+
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">
45+
46+
<assetic:config debug="%kernel.debug%" use-controller="%kernel.debug%">
47+
<assetic:filters cssrewrite="null" />
48+
</assetic:config>
49+
50+
<!-- ... -->
51+
</container>
52+
53+
.. code-block:: php
54+
55+
// app/config/config.php
56+
57+
$container->loadFromExtension('assetic', array(
58+
'debug' => '%kernel.debug%',
59+
'use_controller' => '%kernel.debug%',
60+
'filters' => array(
61+
'cssrewrite' => null,
62+
),
63+
// ...
64+
));
65+
66+
// ...
1667
1768
Assetic combines two major ideas: :ref:`assets <cookbook-assetic-assets>` and
1869
:ref:`filters <cookbook-assetic-filters>`. The assets are files such as CSS,

cookbook/assetic/index.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ Assetic
44
.. caution::
55

66
Starting from Symfony 2.8, Assetic is no longer included by default in the
7-
Symfony Standard Edition. Before using any of its features, install the
8-
AsseticBundle executing this command command in your project:
9-
10-
.. code-block:: cli
11-
12-
$ composer install symfony/assetic-bundle
7+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
8+
to learn how to install and enable Assetic in your Symfony application.
139

1410
.. toctree::
1511
:maxdepth: 2

cookbook/assetic/jpeg_optimize.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ How to Use Assetic for Image Optimization with Twig Functions
77
.. caution::
88

99
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 command command in your project:
12-
13-
.. code-block:: cli
14-
15-
$ composer install symfony/assetic-bundle
10+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
11+
to learn how to install and enable Assetic in your Symfony application.
1612

1713
Among its many filters, Assetic has four filters which can be used for on-the-fly
1814
image optimization. This allows you to get the benefits of smaller file sizes

cookbook/assetic/php.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ Combining, Compiling and Minimizing Web Assets with PHP Libraries
77
.. caution::
88

99
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 command command in your project:
12-
13-
.. code-block:: cli
14-
15-
$ composer install symfony/assetic-bundle
10+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
11+
to learn how to install and enable Assetic in your Symfony application.
1612

1713
The official Symfony Best Practices recommend to use Assetic to
1814
:doc:`manage web assets </best_practices/web-assets>`, unless you are

cookbook/assetic/uglifyjs.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ How to Minify CSS/JS Files (Using UglifyJS and UglifyCSS)
77
.. caution::
88

99
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 command command in your project:
12-
13-
.. code-block:: cli
14-
15-
$ composer install symfony/assetic-bundle
10+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
11+
to learn how to install and enable Assetic in your Symfony application.
1612

1713
`UglifyJS`_ is a JavaScript parser/compressor/beautifier toolkit. It can be used
1814
to combine and minify JavaScript assets so that they require less HTTP requests

cookbook/assetic/yuicompressor.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@ How to Minify JavaScripts and Stylesheets with YUI Compressor
1313
.. caution::
1414

1515
Starting from Symfony 2.8, Assetic is no longer included by default in the
16-
Symfony Standard Edition. Before using any of its features, install the
17-
AsseticBundle executing this command command in your project:
18-
19-
.. code-block:: cli
20-
21-
$ composer install symfony/assetic-bundle
16+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
17+
to learn how to install and enable Assetic in your Symfony application.
2218

2319
Yahoo! provides an excellent utility for minifying JavaScripts and stylesheets
2420
so they travel over the wire faster, the `YUI Compressor`_. Thanks to Assetic,

reference/configuration/assetic.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ AsseticBundle Configuration ("assetic")
77
.. caution::
88

99
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 command command in your project:
12-
13-
.. code-block:: cli
14-
15-
$ composer install symfony/assetic-bundle
10+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
11+
to learn how to install and enable Assetic in your Symfony application.
1612

1713
Full Default Configuration
1814
--------------------------

0 commit comments

Comments
 (0)