Skip to content

Commit

Permalink
[#5166] Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Jun 27, 2015
1 parent 6c05874 commit bf18f16
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions cookbook/assetic/php.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ some scenarios:
* If you want to simplify application deployment.

In this article, you'll learn how to combine and minimize CSS and JavaScript files
and how to compile Sass files using PHP only libraries with Assetic.
and how to compile Sass files using PHP-only libraries with Assetic.

Installing the Third-Party Compression Libraries
------------------------------------------------
Expand All @@ -39,10 +39,9 @@ dependency because the most recent stable version is not compatible with Assetic
Organizing your Web Asset Files
-------------------------------

This example shows the common scenario of using the Bootstrap framework, the
jQuery library, the FontAwesome icon fonts and some regular CSS and JavaScript
application files (called ``main.css`` and ``main.js``). The recommended directory
structure for this set-up is the following:
This example will include a setup using the Bootstrap CSS framework, jQuery, FontAwesome
and some regular CSS and and JavaScript application files (called ``main.css`` and
``main.js``). The recommended directory structure for this set-up looks like this:

.. code-block:: text
Expand Down Expand Up @@ -74,7 +73,7 @@ structure for this set-up is the following:
Combining and Minimizing CSS Files and Compiling SCSS Files
-----------------------------------------------------------

First, configure a new ``scssphp`` Assetic filter as follows:
First, configure a new ``scssphp`` Assetic filter:

.. configuration-block::

Expand Down Expand Up @@ -114,11 +113,10 @@ First, configure a new ``scssphp`` Assetic filter as follows:
The value of the ``formatter`` option is the fully qualified class name of the
formatter used by the filter to produce the compiled CSS file. Using the
compressed formatter allows to minimize the resulting file, no matter if the
original files are regular CSS files or SCSS files.
compressed formatter will minimize the the resulting file, regardless of whether
the original files are regular CSS files or SCSS files.

Then, update the code of your Twig template to add the ``{% stylesheets %}`` tag
defined by Assetic:
Next, your Twig template to add the ``{% stylesheets %}`` tag defined by Assetic:

.. code-block:: html+jinja

Expand Down Expand Up @@ -178,7 +176,7 @@ First, configure a new ``jsqueeze`` Assetic filter as follows:
),
));
Then, update the code of your Twig template to add the ``{% javascripts %}`` tag
Next, update the code of your Twig template to add the ``{% javascripts %}`` tag
defined by Assetic:

.. code-block:: html+jinja
Expand All @@ -200,6 +198,6 @@ This simple configuration combines all the JavaScript files, minimizes the conte
and saves the output in the ``web/js/app.js`` file, which is the one that is
served to your visitors.

The leading ``?`` character in the ``jsqueeze`` filter name indicates that it must
be applied only when the ``debug`` mode is disabled in the application, which
usually occurs in the production environment.
The leading ``?`` character in the ``jsqueeze`` filter name tells Assetic to only
apply the filter when *not* in ``debug`` mode. In practice, this means that you'll
see unminified files while developing and minimized files in the ``prod`` environment.

0 comments on commit bf18f16

Please sign in to comment.