Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 47024b4

Browse filesBrowse files
committed
Merge branch '3.4'
* 3.4: Adding missing the Fix autoescape_service example Proofread encore Fixed typo in Encore/Shared-Entry page Add missing argument to code example Fix some typos align travis and platform build environments Fix some typos Adding header to separate sections Adding missing workflow.entered events Create tags.rst Update tags.rst Fixed app/config/services.yml link Minor reword of the intro of the routing/conditions article Minor reword for the intro of the Templating article Fixed indentation in a configuration block Update LessThan.rst "Basic Usage" part Fix typo minor #7999 Small grammatical improvement (catchamonkey) [DI] Automatically applying a tag to all services implementing an interface
2 parents 568f952 + d3aeca9 commit 47024b4
Copy full SHA for 47024b4

22 files changed

+109
-86
lines changed

‎.platform.app.yaml

Copy file name to clipboardExpand all lines: .platform.app.yaml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ hooks:
5757
export PIP_USER=
5858
pip install pip==9.0.1 wheel==0.29.0
5959
pip install -r _build/.requirements.txt
60+
find .virtualenv -type f -name "*.rst" -delete
6061
make -C _build html

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ sudo: false
66
cache:
77
directories: [$HOME/.cache/pip]
88

9-
install: pip install sphinx~=1.3.0 git+https://github.com/fabpot/sphinx-php.git
9+
install: pip install -r _build/.requirements.txt
1010

11-
script: sphinx-build -nW -c _build/ -b html -d _build/doctrees . _build/html
11+
script: make -C _build SPHINXOPTS=-nW html
1212

1313
branches:
1414
except:

‎_build/.requirements.txt

Copy file name to clipboard
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
alabaster==0.7.9
2-
Babel==2.3.4
1+
alabaster==0.7.10
2+
Babel==2.4.0
33
docutils==0.13.1
44
imagesize==0.7.1
5-
Jinja2==2.9.4
6-
MarkupSafe==0.23
5+
Jinja2==2.9.6
6+
MarkupSafe==1.0
77
Pygments==2.2.0
8-
pytz==2016.10
8+
pytz==2017.2
99
requests==2.12.5
1010
six==1.10.0
1111
snowballstemmer==1.2.1
12-
Sphinx==1.5.2
12+
Sphinx==1.3.6
1313
git+https://github.com/fabpot/sphinx-php.git@7312eccce9465640752e51373a480da700e02345#egg_name=sphinx-php
14-

‎frontend.rst

Copy file name to clipboardExpand all lines: frontend.rst
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,8 @@ Full API
6262

6363
* `Full API`_: https://github.com/symfony/webpack-encore/blob/master/index.js
6464

65-
.. _`Webpack Encore`: https://www.npmjs.com/package/@symfony/webpack-encore
66-
.. _`Webpack`: https://webpack.js.org/
67-
.. _`Webpacker`: https://github.com/rails/webpacker
68-
.. _`Mix`: https://laravel.com/docs/5.4/mix
69-
.. _`Symfony`: http://symfony.com/
70-
.. _`Full API`: https://github.com/symfony/webpack-encore/blob/master/index.js
71-
65+
Other Front-End Articles
66+
........................
7267

7368
.. toctree::
7469
:maxdepth: 1
@@ -81,3 +76,10 @@ Full API
8176
:glob:
8277

8378
frontend/encore/*
79+
80+
.. _`Webpack Encore`: https://www.npmjs.com/package/@symfony/webpack-encore
81+
.. _`Webpack`: https://webpack.js.org/
82+
.. _`Webpacker`: https://github.com/rails/webpacker
83+
.. _`Mix`: https://laravel.com/docs/5.4/mix
84+
.. _`Symfony`: http://symfony.com/
85+
.. _`Full API`: https://github.com/symfony/webpack-encore/blob/master/index.js

‎frontend/encore/bootstrap.rst

Copy file name to clipboardExpand all lines: frontend/encore/bootstrap.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Importing Bootstrap Sass
1313
------------------------
1414

1515
Now that ``bootstrap-sass`` lives in your ``node_modules`` directory, you can
16-
import it from any Sass or JavaScript file. For example, if you're already have
16+
import it from any Sass or JavaScript file. For example, if you already have
1717
a ``global.scss`` file, import it from there:
1818

1919
.. code-block:: css
@@ -71,7 +71,7 @@ Bootstrap JavaScript requires jQuery, so make sure you have this installed:
7171
7272
$ yarn add jquery --dev
7373
74-
Next, make sure call ``.autoProvidejQuery()`` in your ``webpack.config.js`` file:
74+
Next, make sure to call ``.autoProvidejQuery()`` in your ``webpack.config.js`` file:
7575

7676
.. code-block:: diff
7777

‎frontend/encore/cdn.rst

Copy file name to clipboardExpand all lines: frontend/encore/cdn.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ e.g. ``https://my-cool-app.com.global.prod.fastly.net/dashboard.js``.
3636
directly from your web server.
3737

3838
You *do* need to make sure that the ``script`` and ``link`` tags you include on your
39-
pages also uses the CDN. Fortunately, the ``manifest.json`` paths are updated to
39+
pages also use the CDN. Fortunately, the ``manifest.json`` paths are updated to
4040
point to the CDN. In Symfony, as long as you've configured
4141
:doc:`Asset Versioning </frontend/encore/versioning>`, you're done! The ``manifest.json``
4242
file includes the full CDN URL:

‎frontend/encore/css-preprocessors.rst

Copy file name to clipboardExpand all lines: frontend/encore/css-preprocessors.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CSS Preprocessors: Sass, LESS, etc
2-
==================================
1+
CSS Preprocessors: Sass, LESS, etc.
2+
===================================
33

44
Using Sass
55
----------
@@ -22,7 +22,7 @@ And enable it in ``webpack.config.js``:
2222
.enableSassLoader()
2323
;
2424
25-
That's it! All files ending in ``.sass`` or ``.scss`` will be processed.
25+
That's it! All files ending in ``.sass`` or ``.scss`` will be pre-processed.
2626

2727
Using LESS
2828
----------

‎frontend/encore/dev-server.rst

Copy file name to clipboardExpand all lines: frontend/encore/dev-server.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Using webpack-dev-server and HMR
22
================================
33

4-
While developing, instead of using ``encore dev --watch``, you can instead use the
4+
While developing, instead of using ``encore dev --watch``, you can use the
55
`webpack-dev-server`_:
66

77
.. code-block:: terminal

‎frontend/encore/page-specific-assets.rst

Copy file name to clipboardExpand all lines: frontend/encore/page-specific-assets.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tag for ``checkout.css`` if you import any CSS).
2828
Multiple Entries Per Page?
2929
--------------------------
3030

31-
Typically, you should include only *one* entry JavaScript per page. This means
31+
Typically, you should include only *one* JavaScript entry per page. This means
3232
the checkout page will include ``checkout.js``, but will *not* include the
3333
``app.js`` that's used on the other pages. Think of the checkout page as its
3434
own "app", where ``checkout.js`` includes all the functionality you need.

‎frontend/encore/server-data.rst

Copy file name to clipboardExpand all lines: frontend/encore/server-data.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Fetch this in JavaScript:
2626
There is no size limit for the value of the ``data-`` attributes, so you can
2727
store any content. In Twig, use the ``html_attr`` escaping strategy to avoid messing
2828
with HTML attributes. For example, if your ``User`` object has some ``getProfileData()``
29-
method that returns an array, you could:
29+
method that returns an array, you could do the following:
3030

3131
.. code-block:: twig
3232

‎frontend/encore/shared-entry.rst

Copy file name to clipboardExpand all lines: frontend/encore/shared-entry.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ that's included on every page:
1010
1111
Encore
1212
// ...
13-
.addEntry('page1', 'asssets/js/page1.js')
14-
.addEntry('page2', 'asssets/js/page2.js')
13+
.addEntry('page1', 'assets/js/page1.js')
14+
.addEntry('page2', 'assets/js/page2.js')
1515
1616
// this creates a 'vendor.js' file with jquery and the bootstrap JS module
1717
// these modules will *not* be included in page1.js or page2.js anymore

‎frontend/encore/simple-example.rst

Copy file name to clipboardExpand all lines: frontend/encore/simple-example.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Inside, use Encore to help generate your Webpack configuration.
4040
// allow sass/scss files to be processed
4141
.enableSassLoader()
4242
43-
// allows legacy applications to use $/jQuery as a global variable
43+
// allow legacy applications to use $/jQuery as a global variable
4444
.autoProvidejQuery()
4545
4646
.enableSourceMaps(!Encore.isProduction())
@@ -99,7 +99,7 @@ In Symfony, use the ``asset()`` helper:
9999
Requiring JavaScript Modules
100100
----------------------------
101101

102-
Webpack is module bundler... which means that you can ``require`` other JavaScript
102+
Webpack is a module bundler... which means that you can ``require`` other JavaScript
103103
files. First, create a file that exports a function:
104104

105105
.. code-block:: javascript
@@ -128,8 +128,8 @@ Great! Use ``require()`` to import ``jquery`` and ``greet.js``:
128128
// ./ (or ../) means to look for a local file
129129
var greet = require('./greet');
130130
131-
$(document).ready(function()) {
132-
$('h1').html(greet());
131+
$(document).ready(function() {
132+
$('h1').html(greet('john'));
133133
});
134134
135135
That's it! When you build your assets, jQuery and ``greet.js`` will automatically

‎frontend/encore/sourcemaps.rst

Copy file name to clipboardExpand all lines: frontend/encore/sourcemaps.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Enabling Source Maps
22
====================
33

4-
`Source maps`_ allow browsers to access to the original code related to some
4+
`Source maps`_ allow browsers to access the original code related to some
55
asset (e.g. the Sass code that was compiled to CSS or the TypeScript code that
66
was compiled to JavaScript). Source maps are useful for debugging purposes but
77
unnecessary when executing the application in production.

‎frontend/encore/versioning.rst

Copy file name to clipboardExpand all lines: frontend/encore/versioning.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ By calling ``enableVersioning()``, each filename will now include a hash that
88
changes whenever the *contents* of that file change (e.g. ``app.123abc.js``
99
instead of ``app.js``). This allows you to use aggressive caching strategies
1010
(e.g. a far future ``Expires``) because, whenever a file change, its hash will change,
11-
invalidating any existing cache:
11+
ignoring any existing cache:
1212

1313
.. code-block:: diff
1414

‎reference/configuration/twig.rst

Copy file name to clipboardExpand all lines: reference/configuration/twig.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ TwigBundle Configuration ("twig")
4343
autoescape: ~
4444
4545
# See http://twig.sensiolabs.org/doc/recipes.html#using-the-template-name-to-set-the-default-escaping-strategy
46-
autoescape_service: ~ # Example: '@my_service'
46+
autoescape_service: ~ # Example: 'my_service'
4747
autoescape_service_method: ~ # use in combination with autoescape_service option
4848
base_template_class: ~ # Example: Twig_Template
4949
cache: '%kernel.cache_dir%/twig'

‎reference/constraints/LessThan.rst

Copy file name to clipboardExpand all lines: reference/constraints/LessThan.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Basic Usage
2323

2424
The following constraints ensure that:
2525

26-
* the number of ``siblings`` of a ``Person`` is less than or equal to ``5``
27-
* ``age`` is less than``80``
26+
* the number of ``siblings`` of a ``Person`` is less than ``5``
27+
* ``age`` is less than ``80``
2828

2929
.. configuration-block::
3030

‎reference/twig_reference.rst

Copy file name to clipboardExpand all lines: reference/twig_reference.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ set for the package and the URL path. More information in
126126
:ref:`templating-assets`. For asset versioning, see
127127
:ref:`reference-framework-assets-version`.
128128

129-
assets_version
129+
asset_version
130130
~~~~~~~~~~~~~~
131131

132132
.. code-block:: twig
133133
134-
{{ assets_version(packageName = null) }}
134+
{{ asset_version(packageName = null) }}
135135
136136
``packageName`` *(optional)*
137137
**type**: ``string`` | ``null`` **default**: ``null``

‎routing/conditions.rst

Copy file name to clipboardExpand all lines: routing/conditions.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
How to Restrict Route Matching through Conditions
55
=================================================
66

7-
As you've seen, a route can be made to match only certain routing wildcards
8-
(via regular expressions), HTTP methods, or host names. But the routing system
9-
can be extended to have an almost infinite flexibility using ``conditions``:
7+
A route can be made to match only certain routing placeholders (via regular
8+
expressions), HTTP methods, or host names. If you need more flexibility to
9+
define arbitrary matching logic, use the ``conditions`` routing option:
1010

1111
.. configuration-block::
1212

‎service_container.rst

Copy file name to clipboardExpand all lines: service_container.rst
+36-36Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ You can also fetch a service directly from the container via its "id", which wil
238238
be its class name in this case::
239239

240240
use AppBundle\Service\MessageGenerator;
241-
241+
242242
// accessing services like this only works if you extend Controller
243243
class ProductController extends Controller
244244
{
@@ -475,7 +475,7 @@ pass here. No problem! In your configuration, you can explicitly set this argume
475475
476476
// app/config/services.php
477477
use AppBundle\Updates\SiteUpdateManager;
478-
478+
479479
// _defaults and importing directories does not work in PHP
480480
// but registering a service explicitly does
481481
$container->autowire(SiteUpdateManager::class)
@@ -773,7 +773,7 @@ from the container::
773773
public function newAction(MessageGenerator $messageGenerator)
774774
{
775775
// type-hinting it as an argument DOES work
776-
776+
777777
// but accessing it directly from the container does NOT Work
778778
$this->container->get(MessageGenerator::class);
779779
}
@@ -818,47 +818,47 @@ Importing Many Services at once with resource
818818
You've already seen that you can import many services at once by using the ``resource``
819819
key. For example, the default Symfony configuration contains this:
820820

821-
.. configuration-block::
821+
.. configuration-block::
822822

823-
.. code-block:: yaml
823+
.. code-block:: yaml
824824
825-
# app/config/services.yml
826-
services:
827-
# ...
825+
# app/config/services.yml
826+
services:
827+
# ...
828828
829-
# the namespace prefix for classes (must end in \)
830-
AppBundle\:
831-
# accepts a glob pattern
832-
resource: '../../src/AppBundle/*'
833-
# exclude some paths
834-
exclude: '../../src/AppBundle/{Entity,Repository}'
829+
# the namespace prefix for classes (must end in \)
830+
AppBundle\:
831+
# accepts a glob pattern
832+
resource: '../../src/AppBundle/*'
833+
# exclude some paths
834+
exclude: '../../src/AppBundle/{Entity,Repository}'
835835
836-
# these were imported above, but we want to add some extra config
837-
AppBundle\Controller\:
838-
resource: '../../src/AppBundle/Controller'
839-
# apply some configuration to these services
840-
public: true
841-
tags: ['controller.service_arguments']
836+
# these were imported above, but we want to add some extra config
837+
AppBundle\Controller\:
838+
resource: '../../src/AppBundle/Controller'
839+
# apply some configuration to these services
840+
public: true
841+
tags: ['controller.service_arguments']
842842
843-
.. code-block:: xml
843+
.. code-block:: xml
844844
845-
<!-- app/config/services.xml -->
846-
<?xml version="1.0" encoding="UTF-8" ?>
847-
<container xmlns="http://symfony.com/schema/dic/services"
848-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
849-
xsi:schemaLocation="http://symfony.com/schema/dic/services
850-
http://symfony.com/schema/dic/services/services-1.0.xsd">
845+
<!-- app/config/services.xml -->
846+
<?xml version="1.0" encoding="UTF-8" ?>
847+
<container xmlns="http://symfony.com/schema/dic/services"
848+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
849+
xsi:schemaLocation="http://symfony.com/schema/dic/services
850+
http://symfony.com/schema/dic/services/services-1.0.xsd">
851851
852-
<services>
853-
<!-- ... -->
852+
<services>
853+
<!-- ... -->
854854
855-
<prototype namespace="AppBundle\" resource="../../src/AppBundle/*" exclude="../../src/AppBundle/{Entity,Repository}" />
855+
<prototype namespace="AppBundle\" resource="../../src/AppBundle/*" exclude="../../src/AppBundle/{Entity,Repository}" />
856856
857-
<prototype namespace="AppBundle\Controller\" resource="../../src/AppBundle/Controller" public="true">
858-
<tag name="controller.service_arguments" />
859-
</prototype>
860-
</services>
861-
</container>
857+
<prototype namespace="AppBundle\Controller\" resource="../../src/AppBundle/Controller" public="true">
858+
<tag name="controller.service_arguments" />
859+
</prototype>
860+
</services>
861+
</container>
862862
863863
This can be used to quickly make many classes available as services and apply some
864864
default configuration. The ``id`` of each service is its fully-qualified class name.
@@ -1002,4 +1002,4 @@ Learn more
10021002
/service_container/*
10031003

10041004
.. _`service-oriented architecture`: https://en.wikipedia.org/wiki/Service-oriented_architecture
1005-
.. _`Symfony Standard Edition (version 3.3) services.yml`: https://github.com/symfony/symfony-standard/blob/master/app/config/services.yml
1005+
.. _`Symfony Standard Edition (version 3.3) services.yml`: https://github.com/symfony/symfony-standard/blob/3.3/app/config/services.yml

‎service_container/tags.rst

Copy file name to clipboardExpand all lines: service_container/tags.rst
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,25 @@ then some tags are automatically applied for you. That's true for the ``twig.ext
7070
tag: the container sees that your class extends ``Twig_Extension`` (or more accurately,
7171
that it implements ``Twig_ExtensionInterface``) and adds the tag for you.
7272

73+
.. tip::
74+
75+
To apply a tag to all your autoconfigured services extending a class or an
76+
interface, call the :method:`Symfony\\Component\\DependencyInjection\\ContainerBuilder::registerForAutoconfiguration`
77+
method in an :doc:`extension </bundles/extension>` or from your kernel::
78+
79+
// app/AppKernel.php
80+
class AppKernel extends Kernel
81+
{
82+
// ...
83+
84+
protected function build(ContainerBuilder $container)
85+
{
86+
$container->registerForAutoconfiguration(CustomInterface::class)
87+
->addTag('app.custom_tag')
88+
;
89+
}
90+
}
91+
7392
Creating custom Tags
7493
--------------------
7594

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.