@@ -238,7 +238,7 @@ To use a filter, you first need to specify it in the Assetic configuration.
238
238
Adding a filter here doesn't mean it's being used - it just means that it's
239
239
available to use (you'll use the filter below).
240
240
241
- For example to use the JavaScript YUI Compressor the following config should
241
+ For example to use the UglifyJS JavaScript minifier the following config should
242
242
be added:
243
243
244
244
.. configuration-block ::
@@ -248,25 +248,25 @@ be added:
248
248
# app/config/config.yml
249
249
assetic :
250
250
filters :
251
- yui_js :
252
- jar : " %kernel.root_dir%/Resources/java/yuicompressor.jar "
251
+ uglifyjs2 :
252
+ bin : /usr/local/bin/uglifyjs
253
253
254
254
.. code-block :: xml
255
255
256
256
<!-- app/config/config.xml -->
257
257
<assetic : config >
258
258
<assetic : filter
259
- name =" yui_js "
260
- jar = " %kernel.root_dir%/Resources/java/yuicompressor.jar " />
259
+ name =" uglifyjs2 "
260
+ bin = " /usr/local/bin/uglifyjs " />
261
261
</assetic : config >
262
262
263
263
.. code-block :: php
264
264
265
265
// app/config/config.php
266
266
$container->loadFromExtension('assetic', array(
267
267
'filters' => array(
268
- 'yui_js ' => array(
269
- 'jar ' => '%kernel.root_dir%/Resources/java/yuicompressor.jar ',
268
+ 'uglifyjs2 ' => array(
269
+ 'bin ' => '/usr/local/bin/uglifyjs ',
270
270
),
271
271
),
272
272
));
@@ -278,21 +278,21 @@ into your template:
278
278
279
279
.. code-block :: html+jinja
280
280
281
- {% javascripts '@AcmeFooBundle/Resources/public/js/*' filter='yui_js ' %}
281
+ {% javascripts '@AcmeFooBundle/Resources/public/js/*' filter='uglifyjs2 ' %}
282
282
<script src="{{ asset_url }}"></script>
283
283
{% endjavascripts %}
284
284
285
285
.. code-block :: html+php
286
286
287
287
<?php foreach ($view['assetic']->javascripts(
288
288
array('@AcmeFooBundle/Resources/public/js/*'),
289
- array('yui_js ')
289
+ array('uglifyjs2 ')
290
290
) as $url): ?>
291
291
<script src="<?php echo $view->escape($url) ?>"></script>
292
292
<?php endforeach; ?>
293
293
294
294
A more detailed guide about configuring and using Assetic filters as well as
295
- details of Assetic's debug mode can be found in :doc: `/cookbook/assetic/yuicompressor `.
295
+ details of Assetic's debug mode can be found in :doc: `/cookbook/assetic/uglifyjs `.
296
296
297
297
Controlling the URL used
298
298
------------------------
0 commit comments