@@ -43,8 +43,9 @@ 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 both:ref: `CSS stylesheets <cookbook-assetic-including-css >`
47- and:ref: `JavaScript files <cookbook-assetic-including-javascript >`. The philosophy
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
4849behind adding either is basically the same, but with a slightly different syntax.
4950
5051.. _cookbook-assetic-including-javascript :
@@ -128,6 +129,32 @@ the :ref:`cssrewrite <cookbook-assetic-cssrewrite>` filter.
128129 that there is a known issue that causes the ``cssrewrite `` filter to fail
129130 when using the ``@AcmeFooBundle `` syntax for CSS Stylesheets.
130131
132+ .. _cookbook-assetic-including-image :
133+
134+ Including images
135+ ~~~~~~~~~~~~~~~~
136+
137+ To include an image you can use the ``image `` tag.
138+
139+ ..configuration-block ::
140+
141+ ..code-block ::html+jinja
142+
143+ {% image '@AcmeFooBundle/Resources/public/images/example.jpg' %}
144+ <img src="{{ asset_url }}" alt="Example" />
145+ {% endimage %}
146+
147+ ..code-block ::html+php
148+
149+ <?php foreach ($view['assetic']->image(
150+ array('@AcmeFooBundle/Resources/public/images/example.jpg')
151+ ) as $url): ?>
152+ <img src="<?php echo $view->escape($url) ?>" alt="Example" />
153+ <?php endforeach; ?>
154+
155+ You can also use Assetic for image optimization. More information in
156+ :doc: `/cookbook/assetic/jpeg_optimize `.
157+
131158.. _cookbook-assetic-cssrewrite :
132159
133160Fixing CSS Paths with the ``cssrewrite `` Filter