From b5ca005d06ea907cd7c99baf5e689c21292f46fe Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Tue, 26 Nov 2013 21:48:11 +0100 Subject: [PATCH] image tag for assetic management added and fixed a typo --- cookbook/assetic/asset_management.rst | 31 +++++++++++++++++++++++++-- cookbook/assetic/jpeg_optimize.rst | 2 +- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/cookbook/assetic/asset_management.rst b/cookbook/assetic/asset_management.rst index 5aa0c561625..fec293606e2 100644 --- a/cookbook/assetic/asset_management.rst +++ b/cookbook/assetic/asset_management.rst @@ -43,8 +43,9 @@ Using Assetic provides many advantages over directly serving the files. The files do not need to be stored where they are served from and can be drawn from various sources such as from within a bundle. -You can use Assetic to process both :ref:`CSS stylesheets ` -and :ref:`JavaScript files `. The philosophy +You can use Assetic to process :ref:`CSS stylesheets `, +:ref:`JavaScript files ` and +:ref:`images `. The philosophy behind adding either is basically the same, but with a slightly different syntax. .. _cookbook-assetic-including-javascript: @@ -128,6 +129,32 @@ the :ref:`cssrewrite ` filter. that there is a known issue that causes the ``cssrewrite`` filter to fail when using the ``@AcmeFooBundle`` syntax for CSS Stylesheets. +.. _cookbook-assetic-including-image: + +Including images +~~~~~~~~~~~~~~~~ + +To include an image you can use the ``image`` tag. + +.. configuration-block:: + + .. code-block:: html+jinja + + {% image '@AcmeFooBundle/Resources/public/images/example.jpg' %} + Example + {% endimage %} + + .. code-block:: html+php + + image( + array('@AcmeFooBundle/Resources/public/images/example.jpg') + ) as $url): ?> + Example + + +You can also use Assetic for image optimization. More information in +:doc:`/cookbook/assetic/jpeg_optimize`. + .. _cookbook-assetic-cssrewrite: Fixing CSS Paths with the ``cssrewrite`` Filter diff --git a/cookbook/assetic/jpeg_optimize.rst b/cookbook/assetic/jpeg_optimize.rst index f02c18d986d..ff1ef34ae96 100644 --- a/cookbook/assetic/jpeg_optimize.rst +++ b/cookbook/assetic/jpeg_optimize.rst @@ -64,7 +64,7 @@ It can now be used from a template: .. code-block:: html+php - images( + image( array('@AcmeFooBundle/Resources/public/images/example.jpg'), array('jpegoptim') ) as $url): ?>