@@ -36,10 +36,10 @@ directory and execute the following commands:
36
36
It's very important to maintain the ``~1.0 `` version constraint for the ``jsqueeze ``
37
37
dependency because the most recent stable version is not compatible with Assetic.
38
38
39
- Organizing Your Web Asset Files
39
+ Organizing your Web Asset Files
40
40
-------------------------------
41
41
42
- This example shows the very common scenario of using the Bootstrap framework, the
42
+ This example shows the common scenario of using the Bootstrap framework, the
43
43
jQuery library, the FontAwesome icon fonts and some regular CSS and JavaScript
44
44
application files (called ``main.css `` and ``main.js ``). The recommended directory
45
45
structure for this set-up is the following:
@@ -95,6 +95,7 @@ defined by Assetic:
95
95
96
96
.. code-block :: html+jinja
97
97
98
+ {# app/Resources/views/base.html.twig #}
98
99
<!DOCTYPE html>
99
100
<html>
100
101
<head>
@@ -108,22 +109,47 @@ defined by Assetic:
108
109
<link rel="stylesheet" href="{{ asset_url }}" />
109
110
{% endstylesheets %}
110
111
111
- This simple configuration compiles the SCSS files into regular CSS files, combines
112
- all of them, minimizes the contents and saves the output in the ``web/css/app.css ``
113
- file, which is the one that is served to your visitors.
112
+ This simple configuration compiles, combines and minifies the SCSS files into a
113
+ regular CSS file that's put in ``web/css/app.css ``. This is the only CSS file
114
+ which will be served to your visitors.
114
115
115
116
Combining and Minimizing JavaScript Files
116
117
-----------------------------------------
117
118
118
119
First, configure a new ``jsqueeze `` Assetic filter as follows:
119
120
120
- .. code -block :: yaml
121
+ .. configuration -block ::
121
122
122
- # app/config/config.yml
123
- assetic :
124
- filters :
125
- jsqueeze : ~
126
- # ...
123
+ .. code-block :: yaml
124
+
125
+ # app/config/config.yml
126
+ assetic :
127
+ filters :
128
+ jsqueeze : ~
129
+ # ...
130
+
131
+ .. code-block :: xml
132
+
133
+ <!-- app/config/config.xml -->
134
+ <?xml version =" 1.0" charset =" UTF-8" ?>
135
+ <container xmlns =" http://symfony.com/schema/dic/services"
136
+ xmlns : assetic =" http://symfony.com/schema/dic/assetic" >
137
+
138
+ <assetic : config >
139
+ <filter name =" jsqueeze" />
140
+ <!-- ... -->
141
+ </assetic : config >
142
+ </container >
143
+
144
+ .. code-block :: php
145
+
146
+ // app/config/config.php
147
+ $container->loadFromExtension('assetic', array(
148
+ 'filters' => array(
149
+ 'jsqueeze' => null,
150
+ // ...
151
+ ),
152
+ ));
127
153
128
154
Then, update the code of your Twig template to add the ``{% javascripts %} `` tag
129
155
defined by Assetic:
0 commit comments