44How to Use Assetic for Asset Management
55=======================================
66
7- Assetic combines two major ideas: :ref: `assets <cookbook- assetic-assets >` and
8- :ref: `filters <cookbook- assetic-filters >`. The assets are files such as CSS,
7+ Assetic combines two major ideas: :ref: `assets <assetic-assets >` and
8+ :ref: `filters <assetic-filters >`. The assets are files such as CSS,
99JavaScript and image files. The filters are things that can be applied to
1010these files before they are served to the browser. This allows a separation
1111between the asset files stored in the application and the files actually presented
@@ -34,7 +34,7 @@ load them from anywhere) before serving them. This means you can:
3434
3535* Run image optimizations on your images
3636
37- .. _ cookbook-assetic -assets :
37+ .. _ assetic -assets :
3838
3939Assets
4040------
@@ -43,12 +43,12 @@ Using Assetic provides many advantages over directly serving the files.
4343The files do not need to be stored where they are served from and can be
4444drawn from various sources such as from within a bundle.
4545
46- You can use Assetic to process :ref: `CSS stylesheets <cookbook- assetic-including-css >`,
47- :ref: `JavaScript files <cookbook- assetic-including-javascript >` and
48- :ref: `images <cookbook- assetic-including-image >`. The philosophy
46+ You can use Assetic to process :ref: `CSS stylesheets <assetic-including-css >`,
47+ :ref: `JavaScript files <assetic-including-javascript >` and
48+ :ref: `images <assetic-including-image >`. The philosophy
4949behind adding either is basically the same, but with a slightly different syntax.
5050
51- .. _ cookbook-assetic -including-javascript :
51+ .. _ assetic -including-javascript :
5252
5353Including JavaScript Files
5454~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -89,7 +89,7 @@ To include JavaScript files, use the ``javascripts`` tag in any template:
8989
9090.. tip ::
9191
92- You can also include CSS stylesheets: see :ref: `cookbook- assetic-including-css `.
92+ You can also include CSS stylesheets: see :ref: `assetic-including-css `.
9393
9494In this example, all files in the ``Resources/public/js/ `` directory of the
9595AppBundle will be loaded and served from a different location. The actual
@@ -101,9 +101,9 @@ rendered tag might simply look like:
101101
102102This is a key point: once you let Assetic handle your assets, the files are
103103served from a different location. This *will * cause problems with CSS files
104- that reference images by their relative path. See :ref: `cookbook- assetic-cssrewrite `.
104+ that reference images by their relative path. See :ref: `assetic-cssrewrite `.
105105
106- .. _ cookbook-assetic -including-css :
106+ .. _ assetic -including-css :
107107
108108Including CSS Stylesheets
109109~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -146,7 +146,7 @@ except with the ``stylesheets`` tag:
146146
147147But because Assetic changes the paths to your assets, this *will * break any
148148background images (or other paths) that uses relative paths, unless you use
149- the :ref: `cssrewrite <cookbook- assetic-cssrewrite >` filter.
149+ the :ref: `cssrewrite <assetic-cssrewrite >` filter.
150150
151151.. note ::
152152
@@ -157,7 +157,7 @@ the :ref:`cssrewrite <cookbook-assetic-cssrewrite>` filter.
157157 that there is a known issue that causes the ``cssrewrite `` filter to fail
158158 when using the ``@AppBundle `` syntax for CSS stylesheets.
159159
160- .. _ cookbook-assetic -including-image :
160+ .. _ assetic -including-image :
161161
162162Including Images
163163~~~~~~~~~~~~~~~~
@@ -189,7 +189,7 @@ You can also use Assetic for image optimization. More information in
189189 `LiipImagineBundle `_ community bundle, which allows to compress and
190190 manipulate images (rotate, resize, watermark, etc.) before serving them.
191191
192- .. _ cookbook-assetic -cssrewrite :
192+ .. _ assetic -cssrewrite :
193193
194194Fixing CSS Paths with the ``cssrewrite `` Filter
195195~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -250,7 +250,7 @@ the JavaScript files.
250250 If you're new to Assetic and try to use your application in the ``prod ``
251251 environment (by using the ``app.php `` controller), you'll likely see
252252 that all of your CSS and JS breaks. Don't worry! This is on purpose.
253- For details on using Assetic in the ``prod `` environment, see :ref: `cookbook- assetic-dumping `.
253+ For details on using Assetic in the ``prod `` environment, see :ref: `assetic-dumping `.
254254
255255And combining files doesn't only apply to *your * files. You can also use Assetic to
256256combine third party assets, such as jQuery, with your own into a single file:
@@ -354,7 +354,7 @@ with the ``@named_asset`` notation:
354354 <script src="<?php echo $view->escape($url) ?>"></script>
355355 <?php endforeach ?>
356356
357- .. _ cookbook-assetic -filters :
357+ .. _ assetic -filters :
358358
359359Filters
360360-------
@@ -474,7 +474,7 @@ done from the template and is relative to the public document root:
474474 via configuration on each deployment. For more information, see the
475475 :ref: `reference-framework-assets-version ` configuration option.
476476
477- .. _ cookbook-assetic -dumping :
477+ .. _ assetic -dumping :
478478
479479Dumping Asset Files
480480-------------------
@@ -508,7 +508,7 @@ by Symfony (as the asset files are in the ``dev`` environment). This is on
508508purpose - letting Symfony generate these files dynamically in a production
509509environment is just too slow.
510510
511- .. _ cookbook-assetic -dump-prod :
511+ .. _ assetic -dump-prod :
512512
513513Instead, each time you use your application in the ``prod `` environment (and therefore,
514514each time you deploy), you should run the following command:
0 commit comments