From 168072b979d7425a9eddb7f266b74ec9ec1b73e2 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 13 Dec 2015 18:55:44 +0100 Subject: [PATCH] [#5973] some minor tweaks --- best_practices/web-assets.rst | 6 +----- cookbook/assetic/_standard_edition_warning.inc | 5 +++++ cookbook/assetic/apply_to_option.rst | 6 +----- cookbook/assetic/asset_management.rst | 14 ++++++-------- cookbook/assetic/index.rst | 6 +----- cookbook/assetic/jpeg_optimize.rst | 6 +----- cookbook/assetic/php.rst | 6 +----- cookbook/assetic/uglifyjs.rst | 6 +----- cookbook/assetic/yuicompressor.rst | 6 +----- reference/configuration/assetic.rst | 6 +----- 10 files changed, 19 insertions(+), 48 deletions(-) create mode 100644 cookbook/assetic/_standard_edition_warning.inc diff --git a/best_practices/web-assets.rst b/best_practices/web-assets.rst index 61a992b8181..f569c6df53a 100644 --- a/best_practices/web-assets.rst +++ b/best_practices/web-assets.rst @@ -35,11 +35,7 @@ much more concise: Using Assetic ------------- -.. caution:: - - Starting from Symfony 2.8, Assetic is no longer included by default in the - Symfony Standard Edition. Refer to :doc:`this article ` - to learn how to install and enable Assetic in your Symfony application. +.. include:: /cookbook/assetic/_standard_edition_warning.inc These days, you probably can't simply create static CSS and JavaScript files and include them in your template. Instead, you'll probably want to combine diff --git a/cookbook/assetic/_standard_edition_warning.inc b/cookbook/assetic/_standard_edition_warning.inc new file mode 100644 index 00000000000..1ceab3eba35 --- /dev/null +++ b/cookbook/assetic/_standard_edition_warning.inc @@ -0,0 +1,5 @@ +.. caution:: + + Starting from Symfony 2.8, Assetic is no longer included by default in the + Symfony Standard Edition. Refer to :doc:`this article ` + to learn how to install and enable Assetic in your Symfony application. diff --git a/cookbook/assetic/apply_to_option.rst b/cookbook/assetic/apply_to_option.rst index 6f132ec4641..302a72c3eef 100644 --- a/cookbook/assetic/apply_to_option.rst +++ b/cookbook/assetic/apply_to_option.rst @@ -4,11 +4,7 @@ How to Apply an Assetic Filter to a specific File Extension =========================================================== -.. caution:: - - Starting from Symfony 2.8, Assetic is no longer included by default in the - Symfony Standard Edition. Refer to :doc:`this article ` - to learn how to install and enable Assetic in your Symfony application. +.. include:: /cookbook/assetic/_standard_edition_warning.inc Assetic filters can be applied to individual files, groups of files or even, as you'll see here, files that have a specific extension. To show you how diff --git a/cookbook/assetic/asset_management.rst b/cookbook/assetic/asset_management.rst index 6fa15d80e5d..e6019418aac 100644 --- a/cookbook/assetic/asset_management.rst +++ b/cookbook/assetic/asset_management.rst @@ -15,7 +15,7 @@ AsseticBundle executing this console command in your project: $ composer require symfony/assetic-bundle -Then, enable the bundle in the ``AppKernel`` file of your Symfony application:: +Then, enable the bundle in the ``AppKernel.php`` file of your Symfony application:: // app/AppKernel.php @@ -44,8 +44,8 @@ your application: # app/config/config.yml assetic: - debug: "%kernel.debug%" - use_controller: false + debug: '%kernel.debug%' + use_controller: '%kernel.debug%' filters: cssrewrite: ~ @@ -57,12 +57,11 @@ your application: + http://symfony.com/schema/dic/assetic + http://symfony.com/schema/dic/assetic/assetic-1.0.xsd"> @@ -74,7 +73,6 @@ your application: .. code-block:: php // app/config/config.php - $container->loadFromExtension('assetic', array( 'debug' => '%kernel.debug%', 'use_controller' => '%kernel.debug%', diff --git a/cookbook/assetic/index.rst b/cookbook/assetic/index.rst index 8d2ac650587..7389c510d5c 100644 --- a/cookbook/assetic/index.rst +++ b/cookbook/assetic/index.rst @@ -1,11 +1,7 @@ Assetic ======= -.. caution:: - - Starting from Symfony 2.8, Assetic is no longer included by default in the - Symfony Standard Edition. Refer to :doc:`this article ` - to learn how to install and enable Assetic in your Symfony application. +.. include:: /cookbook/assetic/_standard_edition_warning.inc .. toctree:: :maxdepth: 2 diff --git a/cookbook/assetic/jpeg_optimize.rst b/cookbook/assetic/jpeg_optimize.rst index d479fdd8893..55d5f1736f0 100644 --- a/cookbook/assetic/jpeg_optimize.rst +++ b/cookbook/assetic/jpeg_optimize.rst @@ -4,11 +4,7 @@ How to Use Assetic for Image Optimization with Twig Functions ============================================================= -.. caution:: - - Starting from Symfony 2.8, Assetic is no longer included by default in the - Symfony Standard Edition. Refer to :doc:`this article ` - to learn how to install and enable Assetic in your Symfony application. +.. include:: /cookbook/assetic/_standard_edition_warning.inc Among its many filters, Assetic has four filters which can be used for on-the-fly image optimization. This allows you to get the benefits of smaller file sizes diff --git a/cookbook/assetic/php.rst b/cookbook/assetic/php.rst index 3bde1e7aef2..d0bc7dc85a0 100644 --- a/cookbook/assetic/php.rst +++ b/cookbook/assetic/php.rst @@ -4,11 +4,7 @@ Combining, Compiling and Minimizing Web Assets with PHP Libraries ================================================================= -.. caution:: - - Starting from Symfony 2.8, Assetic is no longer included by default in the - Symfony Standard Edition. Refer to :doc:`this article ` - to learn how to install and enable Assetic in your Symfony application. +.. include:: /cookbook/assetic/_standard_edition_warning.inc The official Symfony Best Practices recommend to use Assetic to :doc:`manage web assets `, unless you are diff --git a/cookbook/assetic/uglifyjs.rst b/cookbook/assetic/uglifyjs.rst index 47eb82ba4f6..d05500fb4be 100644 --- a/cookbook/assetic/uglifyjs.rst +++ b/cookbook/assetic/uglifyjs.rst @@ -4,11 +4,7 @@ How to Minify CSS/JS Files (Using UglifyJS and UglifyCSS) ========================================================= -.. caution:: - - Starting from Symfony 2.8, Assetic is no longer included by default in the - Symfony Standard Edition. Refer to :doc:`this article ` - to learn how to install and enable Assetic in your Symfony application. +.. include:: /cookbook/assetic/_standard_edition_warning.inc `UglifyJS`_ is a JavaScript parser/compressor/beautifier toolkit. It can be used to combine and minify JavaScript assets so that they require less HTTP requests diff --git a/cookbook/assetic/yuicompressor.rst b/cookbook/assetic/yuicompressor.rst index 4c2cc87a913..ac8b2980c88 100644 --- a/cookbook/assetic/yuicompressor.rst +++ b/cookbook/assetic/yuicompressor.rst @@ -10,11 +10,7 @@ How to Minify JavaScripts and Stylesheets with YUI Compressor **strongly advised to avoid using YUI utilities** unless strictly necessary. Read :doc:`/cookbook/assetic/uglifyjs` for a modern and up-to-date alternative. -.. caution:: - - Starting from Symfony 2.8, Assetic is no longer included by default in the - Symfony Standard Edition. Refer to :doc:`this article ` - to learn how to install and enable Assetic in your Symfony application. +.. include:: /cookbook/assetic/_standard_edition_warning.inc Yahoo! provides an excellent utility for minifying JavaScripts and stylesheets so they travel over the wire faster, the `YUI Compressor`_. Thanks to Assetic, diff --git a/reference/configuration/assetic.rst b/reference/configuration/assetic.rst index 925f1cf7ac7..10893c5ce5c 100644 --- a/reference/configuration/assetic.rst +++ b/reference/configuration/assetic.rst @@ -4,11 +4,7 @@ AsseticBundle Configuration ("assetic") ======================================= -.. caution:: - - Starting from Symfony 2.8, Assetic is no longer included by default in the - Symfony Standard Edition. Refer to :doc:`this article ` - to learn how to install and enable Assetic in your Symfony application. +.. include:: /cookbook/assetic/_standard_edition_warning.inc Full Default Configuration --------------------------