@@ -265,7 +265,7 @@ To use a filter, you first need to specify it in the Assetic configuration.
265
265
Adding a filter here doesn't mean it's being used - it just means that it's
266
266
available to use (you'll use the filter below).
267
267
268
- For example to use the JavaScript YUI Compressor the following config should
268
+ For example to use the UglifyJS JavaScript minifier the following config should
269
269
be added:
270
270
271
271
.. configuration-block ::
@@ -275,25 +275,25 @@ be added:
275
275
# app/config/config.yml
276
276
assetic :
277
277
filters :
278
- yui_js :
279
- jar : " %kernel.root_dir%/Resources/java/yuicompressor.jar "
278
+ uglifyjs2 :
279
+ bin : /usr/local/bin/uglifyjs
280
280
281
281
.. code-block :: xml
282
282
283
283
<!-- app/config/config.xml -->
284
284
<assetic : config >
285
285
<assetic : filter
286
- name =" yui_js "
287
- jar = " %kernel.root_dir%/Resources/java/yuicompressor.jar " />
286
+ name =" uglifyjs2 "
287
+ bin = " /usr/local/bin/uglifyjs " />
288
288
</assetic : config >
289
289
290
290
.. code-block :: php
291
291
292
292
// app/config/config.php
293
293
$container->loadFromExtension('assetic', array(
294
294
'filters' => array(
295
- 'yui_js ' => array(
296
- 'jar ' => '%kernel.root_dir%/Resources/java/yuicompressor.jar ',
295
+ 'uglifyjs2 ' => array(
296
+ 'bin ' => '/usr/local/bin/uglifyjs ',
297
297
),
298
298
),
299
299
));
@@ -305,21 +305,21 @@ into your template:
305
305
306
306
.. code-block :: html+jinja
307
307
308
- {% javascripts '@AcmeFooBundle/Resources/public/js/*' filter='yui_js ' %}
308
+ {% javascripts '@AcmeFooBundle/Resources/public/js/*' filter='uglifyjs2 ' %}
309
309
<script src="{{ asset_url }}"></script>
310
310
{% endjavascripts %}
311
311
312
312
.. code-block :: html+php
313
313
314
314
<?php foreach ($view['assetic']->javascripts(
315
315
array('@AcmeFooBundle/Resources/public/js/*'),
316
- array('yui_js ')
316
+ array('uglifyjs2 ')
317
317
) as $url): ?>
318
318
<script src="<?php echo $view->escape($url) ?>"></script>
319
319
<?php endforeach; ?>
320
320
321
321
A more detailed guide about configuring and using Assetic filters as well as
322
- details of Assetic's debug mode can be found in :doc: `/cookbook/assetic/yuicompressor `.
322
+ details of Assetic's debug mode can be found in :doc: `/cookbook/assetic/uglifyjs `.
323
323
324
324
Controlling the URL used
325
325
------------------------
0 commit comments