Skip to content

Commit

Permalink
Reworded everything
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Dec 9, 2015
1 parent ee942d9 commit 8e896e6
Showing 1 changed file with 65 additions and 41 deletions.
106 changes: 65 additions & 41 deletions cookbook/assetic/asset_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,90 @@
How to Use Assetic for Asset Management
=======================================

.. caution::
Installing and Enabling Assetic
-------------------------------

Starting from Symfony 2.8, Assetic is no longer included by default in the
Symfony Standard Edition. Before using any of its features, install the
AsseticBundle executing this console command in your project:
Starting from Symfony 2.8, Assetic is no longer included by default in the
Symfony Standard Edition. Before using any of its features, install the
AsseticBundle executing this console command in your project:

.. code-block:: bash
$ composer require symfony/assetic-bundle
Then, enable the bundle by adding the following configuration under the
``asetic`` key:
Then, enable the bundle in the ``AppKernel`` file of your Symfony application::

.. configuration-block::
// app/AppKernel.php

.. code-block:: yaml
// ...
class AppKernel extends Kernel
{
// ...

# app/config/config.yml
assetic:
debug: "%kernel.debug%"
use_controller: false
filters:
cssrewrite: ~
public function registerBundles()
{
$bundles = array(
// ...
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
);

# ...
// ...
}
}

.. code-block:: xml
Finally, add the following minimal configuration to enable Assetic support in
your application:

<!-- app/config/config.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xmlns:twig="http://symfony.com/schema/dic/twig"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
.. configuration-block::

<assetic:config debug="%kernel.debug%" use-controller="%kernel.debug%">
<assetic:filters cssrewrite="null" />
</assetic:config>
.. code-block:: yaml
<!-- ... -->
</container>
# app/config/config.yml
assetic:
debug: "%kernel.debug%"
use_controller: false
filters:
cssrewrite: ~
.. code-block:: php
# ...
// app/config/config.php
.. code-block:: xml
$container->loadFromExtension('assetic', array(
'debug' => '%kernel.debug%',
'use_controller' => '%kernel.debug%',
'filters' => array(
'cssrewrite' => null,
),
// ...
));
<!-- app/config/config.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xmlns:twig="http://symfony.com/schema/dic/twig"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<assetic:config debug="%kernel.debug%" use-controller="%kernel.debug%">
<assetic:filters cssrewrite="null" />
</assetic:config>
<!-- ... -->
</container>
.. code-block:: php
// app/config/config.php
$container->loadFromExtension('assetic', array(
'debug' => '%kernel.debug%',
'use_controller' => '%kernel.debug%',
'filters' => array(
'cssrewrite' => null,
),
// ...
));
// ...
Introducing Assetic
-------------------

Assetic combines two major ideas: :ref:`assets <cookbook-assetic-assets>` and
:ref:`filters <cookbook-assetic-filters>`. The assets are files such as CSS,
Expand Down

0 comments on commit 8e896e6

Please sign in to comment.