File tree Expand file tree Collapse file tree 11 files changed +94
-7
lines changed Expand file tree Collapse file tree 11 files changed +94
-7
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,16 @@ much more concise:
35
35
Using Assetic
36
36
-------------
37
37
38
+ .. caution ::
39
+
40
+ 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
47
+
38
48
These days, you probably can't simply create static CSS and JavaScript files
39
49
and include them in your template. Instead, you'll probably want to combine
40
50
and minify these to improve client-side performance. You may also want to
Original file line number Diff line number Diff line change @@ -1130,9 +1130,9 @@ advantage of Symfony's template inheritance.
1130
1130
.. tip ::
1131
1131
1132
1132
This section will teach you the philosophy behind including stylesheet
1133
- and JavaScript assets in Symfony. Symfony also packages another library,
1134
- called Assetic, which follows this philosophy but allows you to do much
1135
- more interesting things with those assets. For more information on
1133
+ and JavaScript assets in Symfony. Symfony is also compatible with another
1134
+ library, called Assetic, which follows this philosophy but allows you to do
1135
+ much more interesting things with those assets. For more information on
1136
1136
using Assetic see :doc: `/cookbook/assetic/asset_management `.
1137
1137
1138
1138
Start by adding two blocks to your base template that will hold your assets:
Original file line number Diff line number Diff line change 4
4
How to Apply an Assetic Filter to a specific File Extension
5
5
===========================================================
6
6
7
+ .. caution ::
8
+
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 command command in your project:
12
+
13
+ .. code-block :: cli
14
+
15
+ $ composer install symfony/assetic-bundle
16
+
7
17
Assetic filters can be applied to individual files, groups of files or even,
8
18
as you'll see here, files that have a specific extension. To show you how
9
19
to handle each option, suppose that you want to use Assetic's CoffeeScript
Original file line number Diff line number Diff line change 4
4
How to Use Assetic for Asset Management
5
5
=======================================
6
6
7
+ .. caution ::
8
+
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 command command in your project:
12
+
13
+ .. code-block :: cli
14
+
15
+ $ composer install symfony/assetic-bundle
16
+
7
17
Assetic combines two major ideas: :ref: `assets <cookbook-assetic-assets >` and
8
18
:ref: `filters <cookbook-assetic-filters >`. The assets are files such as CSS,
9
19
JavaScript and image files. The filters are things that can be applied to
Original file line number Diff line number Diff line change 1
1
Assetic
2
2
=======
3
3
4
+ .. caution ::
5
+
6
+ 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
13
+
4
14
.. toctree ::
5
15
:maxdepth: 2
6
16
Original file line number Diff line number Diff line change 4
4
How to Use Assetic for Image Optimization with Twig Functions
5
5
=============================================================
6
6
7
+ .. caution ::
8
+
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 command command in your project:
12
+
13
+ .. code-block :: cli
14
+
15
+ $ composer install symfony/assetic-bundle
16
+
7
17
Among its many filters, Assetic has four filters which can be used for on-the-fly
8
18
image optimization. This allows you to get the benefits of smaller file sizes
9
19
without having to use an image editor to process each image. The results
Original file line number Diff line number Diff line change 4
4
Combining, Compiling and Minimizing Web Assets with PHP Libraries
5
5
=================================================================
6
6
7
+ .. caution ::
8
+
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 command command in your project:
12
+
13
+ .. code-block :: cli
14
+
15
+ $ composer install symfony/assetic-bundle
16
+
7
17
The official Symfony Best Practices recommend to use Assetic to
8
18
:doc: `manage web assets </best_practices/web-assets >`, unless you are
9
19
comfortable with JavaScript-based front-end tools.
Original file line number Diff line number Diff line change 4
4
How to Minify CSS/JS Files (Using UglifyJS and UglifyCSS)
5
5
=========================================================
6
6
7
+ .. caution ::
8
+
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 command command in your project:
12
+
13
+ .. code-block :: cli
14
+
15
+ $ composer install symfony/assetic-bundle
16
+
7
17
`UglifyJS `_ is a JavaScript parser/compressor/beautifier toolkit. It can be used
8
18
to combine and minify JavaScript assets so that they require less HTTP requests
9
19
and make your site load faster. `UglifyCSS `_ is a CSS compressor/beautifier
Original file line number Diff line number Diff line change @@ -10,6 +10,16 @@ How to Minify JavaScripts and Stylesheets with YUI Compressor
10
10
**strongly advised to avoid using YUI utilities ** unless strictly necessary.
11
11
Read :doc: `/cookbook/assetic/uglifyjs ` for a modern and up-to-date alternative.
12
12
13
+ .. caution ::
14
+
15
+ 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
22
+
13
23
Yahoo! provides an excellent utility for minifying JavaScripts and stylesheets
14
24
so they travel over the wire faster, the `YUI Compressor `_. Thanks to Assetic,
15
25
you can take advantage of this tool very easily.
Original file line number Diff line number Diff line change 4
4
AsseticBundle Configuration ("assetic")
5
5
=======================================
6
6
7
+ .. caution ::
8
+
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 command command in your project:
12
+
13
+ .. code-block :: cli
14
+
15
+ $ composer install symfony/assetic-bundle
16
+
7
17
Full Default Configuration
8
18
--------------------------
9
19
Original file line number Diff line number Diff line change @@ -739,10 +739,7 @@ Those bundles can have other Twig extensions:
739
739
740
740
* **Twig Extensions ** includes some interesting extensions that do not belong
741
741
to the Twig core. You can read more in `the official Twig Extensions
742
- documentation `_;
743
- * **Assetic ** adds the ``{% stylesheets %} ``, ``{% javascripts %} `` and
744
- ``{% image %} `` tags. You can read more about them in
745
- :doc: `the Assetic Documentation </cookbook/assetic/asset_management >`.
742
+ documentation `_.
746
743
747
744
.. _`Twig Reference` : http://twig.sensiolabs.org/documentation#reference
748
745
.. _`the official Twig Extensions documentation` : http://twig.sensiolabs.org/doc/extensions/index.html
You can’t perform that action at this time.
0 commit comments