@@ -67,22 +67,11 @@ Filter a single File
6767You can now serve up a single CoffeeScript file as JavaScript from within your
6868templates:
6969
70- .. configuration-block ::
71-
72- .. code-block :: html+twig
73-
74- {% javascripts '@AppBundle/Resources/public/js/example.coffee' filter='coffee' %}
75- <script src="{{ asset_url }}"></script>
76- {% endjavascripts %}
70+ .. code-block :: html+twig
7771
78- .. code-block :: html+php
79-
80- <?php foreach ($view['assetic']->javascripts(
81- array('@AppBundle/Resources/public/js/example.coffee'),
82- array('coffee')
83- ) as $url): ?>
84- <script src="<?php echo $view->escape($url) ?>"></script>
85- <?php endforeach ?>
72+ {% javascripts '@AppBundle/Resources/public/js/example.coffee' filter='coffee' %}
73+ <script src="{{ asset_url }}"></script>
74+ {% endjavascripts %}
8675
8776This is all that's needed to compile this CoffeeScript file and serve it
8877as the compiled JavaScript.
@@ -92,27 +81,13 @@ Filter multiple Files
9281
9382You can also combine multiple CoffeeScript files into a single output file:
9483
95- .. configuration-block ::
96-
97- .. code-block :: html+twig
84+ .. code-block :: html+twig
9885
99- {% javascripts '@AppBundle/Resources/public/js/example.coffee'
100- '@AppBundle/Resources/public/js/another.coffee'
101- filter='coffee' %}
102- <script src="{{ asset_url }}"></script>
103- {% endjavascripts %}
104-
105- .. code-block :: html+php
106-
107- <?php foreach ($view['assetic']->javascripts(
108- array(
109- '@AppBundle/Resources/public/js/example.coffee',
110- '@AppBundle/Resources/public/js/another.coffee',
111- ),
112- array('coffee')
113- ) as $url): ?>
114- <script src="<?php echo $view->escape($url) ?>"></script>
115- <?php endforeach ?>
86+ {% javascripts '@AppBundle/Resources/public/js/example.coffee'
87+ '@AppBundle/Resources/public/js/another.coffee'
88+ filter='coffee' %}
89+ <script src="{{ asset_url }}"></script>
90+ {% endjavascripts %}
11691
11792Both files will now be served up as a single file compiled into regular JavaScript.
11893
@@ -188,24 +163,12 @@ template. You can also list regular JavaScript files, all of which will be
188163combined and rendered as a single JavaScript file (with only the ``.coffee ``
189164files being run through the CoffeeScript filter):
190165
191- .. configuration-block ::
166+ .. code-block :: html+twig
167+
168+ {% javascripts '@AppBundle/Resources/public/js/example.coffee'
169+ '@AppBundle/Resources/public/js/another.coffee'
170+ '@AppBundle/Resources/public/js/regular.js' %}
171+ <script src="{{ asset_url }}"></script>
172+ {% endjavascripts %}
173+
192174
193- .. code-block :: html+twig
194-
195- {% javascripts '@AppBundle/Resources/public/js/example.coffee'
196- '@AppBundle/Resources/public/js/another.coffee'
197- '@AppBundle/Resources/public/js/regular.js' %}
198- <script src="{{ asset_url }}"></script>
199- {% endjavascripts %}
200-
201- .. code-block :: html+php
202-
203- <?php foreach ($view['assetic']->javascripts(
204- array(
205- '@AppBundle/Resources/public/js/example.coffee',
206- '@AppBundle/Resources/public/js/another.coffee',
207- '@AppBundle/Resources/public/js/regular.js',
208- )
209- ) as $url): ?>
210- <script src="<?php echo $view->escape($url) ?>"></script>
211- <?php endforeach ?>
0 commit comments