Skip to content

Commit 7c60ea1

Browse files
committed
Merge branch '2.8' into 3.0
Conflicts: best_practices/creating-the-project.rst
2 parents 3ad7f26 + 5275cfb commit 7c60ea1

19 files changed

+126
-18
lines changed

best_practices/creating-the-project.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ to create files and execute the following commands:
3030
$ cd projects/
3131
$ symfony new blog
3232
33+
# Windows
34+
c:\> cd projects/
35+
c:\projects\> php symfony new blog
36+
3337
This command creates a new directory called ``blog`` that contains a fresh new
3438
project based on the most recent stable Symfony version available. In addition,
3539
the installer checks if your system meets the technical requirements to execute
@@ -113,10 +117,10 @@ Symfony documentation uses the AppBundle name.
113117
There is no need to prefix the AppBundle with your own vendor (e.g.
114118
AcmeAppBundle), because this application bundle is never going to be
115119
shared.
116-
120+
117121
.. note::
118-
119-
Another reason to create a new bundle is when you're overriding something
122+
123+
Another reason to create a new bundle is when you're overriding something
120124
in a vendor's bundle (e.g. a controller). See :doc:`/cookbook/bundles/inheritance`.
121125

122126
All in all, this is the typical directory structure of a Symfony application

best_practices/web-assets.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ much more concise:
3535
Using Assetic
3636
-------------
3737

38+
.. include:: /cookbook/assetic/_standard_edition_warning.inc
39+
3840
These days, you probably can't simply create static CSS and JavaScript files
3941
and include them in your template. Instead, you'll probably want to combine
4042
and minify these to improve client-side performance. You may also want to

book/controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ and then redirects. The message key (``notice`` in this example) can be anything
655655
you'll use this key to retrieve the message.
656656

657657
In the template of the next page (or even better, in your base layout template),
658-
read any flash messages from the session::
658+
read any flash messages from the session:
659659

660660
.. configuration-block::
661661

book/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Open your command console and execute the following commands:
3232

3333
.. code-block:: bash
3434
35-
$ sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
35+
$ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
3636
$ sudo chmod a+x /usr/local/bin/symfony
3737
3838
This will create a global ``symfony`` command in your system.
@@ -44,7 +44,7 @@ Open your command console and execute the following command:
4444

4545
.. code-block:: bash
4646
47-
c:\> php -r "readfile('http://symfony.com/installer');" > symfony
47+
c:\> php -r "readfile('https://symfony.com/installer');" > symfony
4848
4949
Then, move the downloaded ``symfony`` file to your project's directory and
5050
execute it as follows:

book/routing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,9 @@ By default, the router will generate relative URLs (e.g. ``/blog``). From
15591559
a controller, simply pass ``true`` to the third argument of the ``generateUrl()``
15601560
method::
15611561

1562-
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
1562+
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1563+
1564+
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
15631565
// http://www.example.com/blog/my-blog-post
15641566

15651567
From a template, simply use the ``url()`` function (which generates an absolute

book/templating.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,9 +1130,9 @@ advantage of Symfony's template inheritance.
11301130
.. tip::
11311131

11321132
This section will teach you the philosophy behind including stylesheet
1133-
and JavaScript assets in Symfony. Symfony also packages another library,
1134-
called Assetic, which follows this philosophy but allows you to do much
1135-
more interesting things with those assets. For more information on
1133+
and JavaScript assets in Symfony. Symfony is also compatible with another
1134+
library, called Assetic, which follows this philosophy but allows you to do
1135+
much more interesting things with those assets. For more information on
11361136
using Assetic see :doc:`/cookbook/assetic/asset_management`.
11371137

11381138
Start by adding two blocks to your base template that will hold your assets:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. caution::
2+
3+
Starting from Symfony 2.8, Assetic is no longer included by default in the
4+
Symfony Standard Edition. Refer to :doc:`this article </cookbook/assetic/asset_management>`
5+
to learn how to install and enable Assetic in your Symfony application.

cookbook/assetic/apply_to_option.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
How to Apply an Assetic Filter to a specific File Extension
55
===========================================================
66

7+
.. include:: /cookbook/assetic/_standard_edition_warning.inc
8+
79
Assetic filters can be applied to individual files, groups of files or even,
810
as you'll see here, files that have a specific extension. To show you how
911
to handle each option, suppose that you want to use Assetic's CoffeeScript

cookbook/assetic/asset_management.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,89 @@
44
How to Use Assetic for Asset Management
55
=======================================
66

7+
Installing and Enabling Assetic
8+
-------------------------------
9+
10+
Starting from Symfony 2.8, Assetic is no longer included by default in the
11+
Symfony Standard Edition. Before using any of its features, install the
12+
AsseticBundle executing this console command in your project:
13+
14+
.. code-block:: bash
15+
16+
$ composer require symfony/assetic-bundle
17+
18+
Then, enable the bundle in the ``AppKernel.php`` file of your Symfony application::
19+
20+
// app/AppKernel.php
21+
22+
// ...
23+
class AppKernel extends Kernel
24+
{
25+
// ...
26+
27+
public function registerBundles()
28+
{
29+
$bundles = array(
30+
// ...
31+
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
32+
);
33+
34+
// ...
35+
}
36+
}
37+
38+
Finally, add the following minimal configuration to enable Assetic support in
39+
your application:
40+
41+
.. configuration-block::
42+
43+
.. code-block:: yaml
44+
45+
# app/config/config.yml
46+
assetic:
47+
debug: '%kernel.debug%'
48+
use_controller: '%kernel.debug%'
49+
filters:
50+
cssrewrite: ~
51+
52+
# ...
53+
54+
.. code-block:: xml
55+
56+
<!-- app/config/config.xml -->
57+
<?xml version="1.0" encoding="UTF-8" ?>
58+
<container xmlns="http://symfony.com/schema/dic/services"
59+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
60+
xmlns:assetic="http://symfony.com/schema/dic/assetic"
61+
xsi:schemaLocation="http://symfony.com/schema/dic/services
62+
http://symfony.com/schema/dic/services/services-1.0.xsd
63+
http://symfony.com/schema/dic/assetic
64+
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">
65+
66+
<assetic:config debug="%kernel.debug%" use-controller="%kernel.debug%">
67+
<assetic:filters cssrewrite="null" />
68+
</assetic:config>
69+
70+
<!-- ... -->
71+
</container>
72+
73+
.. code-block:: php
74+
75+
// app/config/config.php
76+
$container->loadFromExtension('assetic', array(
77+
'debug' => '%kernel.debug%',
78+
'use_controller' => '%kernel.debug%',
79+
'filters' => array(
80+
'cssrewrite' => null,
81+
),
82+
// ...
83+
));
84+
85+
// ...
86+
87+
Introducing Assetic
88+
-------------------
89+
790
Assetic combines two major ideas: :ref:`assets <cookbook-assetic-assets>` and
891
:ref:`filters <cookbook-assetic-filters>`. The assets are files such as CSS,
992
JavaScript and image files. The filters are things that can be applied to

cookbook/assetic/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Assetic
22
=======
33

4+
.. include:: /cookbook/assetic/_standard_edition_warning.inc
5+
46
.. toctree::
57
:maxdepth: 2
68

0 commit comments

Comments
 (0)