8000 Merge pull request #386 from oyerli/patch-1 · lmcd/symfony-docs@cea00a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit cea00a8

Browse files
committed
Merge pull request symfony#386 from oyerli/patch-1
Changed sample directories for js and css files in the Assetic Cookbook
2 parents ec5b4a4 + eb4d908 commit cea00a8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

cookbook/assetic/yuicompressor.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,23 @@ the view layer, this work is done in your templates:
7171

7272
.. code-block:: html+jinja
7373

74-
{% javascripts 'js/src/*' filter='yui_js' %}
74+
{% javascripts '@AcmeFooBundle/Resources/public/js/*' filter='yui_js' %}
7575
<script src="{{ asset_url }}"></script>
7676
{% endjavascripts %}
7777
7878
.. code-block:: html+php
7979

8080
<?php foreach ($view['assetic']->javascripts(
81-
array('js/src/*'),
81+
array('@AcmeFooBundle/Resources/public/js/*'),
8282
array('yui_js')) as $url): ?>
8383
<script src="<?php echo $view->escape($url) ?>"></script>
8484
<?php endforeach; ?>
8585
8686
.. note::
8787

88-
The above example assumes that your JavaScript files are in the ``js/src``
89-
directory. This isn't important however - you can include your Javascript
88+
The above example assumes that you have a bundle called ``AcmeFooBundle``
89+
and your JavaScript files are in the ``Resources/public/js`` directory under
90+
your bundle. This isn't important however - you can include your Javascript
9091
files no matter where they are.
9192

9293
With the addition of the ``yui_js`` filter to the asset tags above, you should
@@ -97,14 +98,14 @@ can be repeated to minify your stylesheets.
9798

9899
.. code-block:: html+jinja
99100

100-
{% stylesheets 'css/src/*' filter='yui_css' %}
101+
{% stylesheets '@AcmeFooBundle/Resources/public/css/*' filter='yui_css' %}
101102
<link rel="stylesheet" type="text/css" media="screen" href="{{ asset_url }}" />
102103
{% endstylesheets %}
103104
104105
.. code-block:: html+php
105106

106107
<?php foreach ($view['assetic']->stylesheets(
107-
array('css/src/*'),
108+
array('@AcmeFooBundle/Resources/public/css/*'),
108109
array('yui_css')) as $url): ?>
109110
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $view->escape($url) ?>" />
110111
<?php endforeach; ?>
@@ -122,14 +123,14 @@ apply this filter when debug mode is off.
122123

123124
.. code-block:: html+jinja
124125

125-
{% javascripts 'js/src/*' filter='?yui_js' %}
126+
{% javascripts '@AcmeFooBundle/Resources/public/js/*' filter='?yui_js' %}
126127
<script src="{{ asset_url }}"></script>
127128
{% endjavascripts %}
128129
129130
.. code-block:: html+php
130131

131132
<?php foreach ($view['assetic']->javascripts(
132-
array('js/src/*'),
133+
array('@AcmeFooBundle/Resources/public/js/*'),
133134
array('?yui_js')) as $url): ?>
134135
<script src="<?php echo $view->escape($url) ?>"></script>
135136
<?php endforeach; ?>

0 commit comments

Comments
 (0)
0