Skip to content

Commit

Permalink
Merge branch '2.3' into 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Mar 7, 2014
2 parents fc28453 + 04cf9f8 commit d6a17e7
Show file tree
Hide file tree
Showing 40 changed files with 247 additions and 83 deletions.
4 changes: 2 additions & 2 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ object that's returned from that controller::
return $response;
}

Notice that the `forward()` method uses the same string representation of
Notice that the ``forward()`` method uses the same string representation of
the controller used in the routing configuration. In this case, the target
controller class will be ``HelloController`` inside some ``AcmeHelloBundle``.
The array passed to the method becomes the arguments on the resulting controller.
Expand Down Expand Up @@ -794,7 +794,7 @@ The Request Object
Besides the values of the routing placeholders, the controller also has access
to the ``Request`` object. The framework injects the ``Request`` object in the
controller if a variable is type-hinted with
`Symfony\Component\HttpFoundation\Request`::
:class:`Symfony\\Component\\HttpFoundation\\Request`::

use Symfony\Component\HttpFoundation\Request;

Expand Down
12 changes: 6 additions & 6 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ these cases you can set the ``validation_groups`` option to ``false``::
Note that when you do that, the form will still run basic integrity checks,
for example whether an uploaded file was too large or whether non-existing
fields were submitted. If you want to suppress validation, you can use the
:ref:`POST_SUBMIT event <cookbook-dynamic-form-modification-suppressing-form-validation>`
:ref:`POST_SUBMIT event <cookbook-dynamic-form-modification-suppressing-form-validation>`.

.. index::
single: Forms; Validation groups based on submitted data
Expand Down Expand Up @@ -1811,7 +1811,7 @@ an array.
$this->get('request')->request->get('name');
Be advised, however, that in most cases using the getData() method is
Be advised, however, that in most cases using the ``getData()`` method is
a better choice, since it returns the data (usually an object) after
it's been transformed by the form framework.
Expand Down Expand Up @@ -1853,7 +1853,7 @@ but here's a short example:
.. tip::
If you are using Validation Groups, you need to either reference the
If you are using validation groups, you need to either reference the
``Default`` group when creating the form, or set the correct group on
the constraint you are adding.
Expand Down Expand Up @@ -1891,7 +1891,7 @@ Learn more from the Cookbook
.. _`Symfony2 Form component`: https://github.com/symfony/Form
.. _`DateTime`: http://php.net/manual/en/class.datetime.php
.. _`Twig Bridge`: https://github.com/symfony/symfony/tree/2.2/src/Symfony/Bridge/Twig
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/2.2/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
.. _`Twig Bridge`: https://github.com/symfony/symfony/tree/2.3/src/Symfony/Bridge/Twig
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/2.3/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
.. _`Cross-site request forgery`: http://en.wikipedia.org/wiki/Cross-site_request_forgery
.. _`view on GitHub`: https://github.com/symfony/symfony/tree/2.2/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form
.. _`view on GitHub`: https://github.com/symfony/symfony/tree/2.3/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form
12 changes: 9 additions & 3 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ authentication (i.e. the old-school username/password box):
realm: "Secured Demo Area"
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/admin/, roles: ROLE_ADMIN }
# Include the following line to also secure the /admin path itself
# - { path: ^/admin$, roles: ROLE_ADMIN }
providers:
in_memory:
Expand Down Expand Up @@ -79,7 +81,9 @@ authentication (i.e. the old-school username/password box):
</firewall>
<access-control>
<rule path="^/admin" role="ROLE_ADMIN" />
<rule path="^/admin/" role="ROLE_ADMIN" />
<!-- Include the following line to also secure the /admin path itself -->
<!-- <rule path="^/admin$" role="ROLE_ADMIN" /> -->
</access-control>
<provider name="in_memory">
Expand Down Expand Up @@ -108,7 +112,9 @@ authentication (i.e. the old-school username/password box):
),
),
'access_control' => array(
array('path' => '^/admin', 'role' => 'ROLE_ADMIN'),
array('path' => '^/admin/', 'role' => 'ROLE_ADMIN'),
// Include the following line to also secure the /admin path itself
// array('path' => '^/admin$', 'role' => 'ROLE_ADMIN'),
),
'providers' => array(
'in_memory' => array(
Expand Down
8 changes: 3 additions & 5 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1146,12 +1146,10 @@ with ``twig.extension`` and automatically registers them as extensions.
Tags, then, are a way to tell Symfony2 or other third-party bundles that
your service should be registered or used in some special way by the bundle.

The following is a list of tags available with the core Symfony2 bundles.
Each of these has a different effect on your service and many tags require
additional arguments (beyond just the ``name`` parameter).

For a list of all the tags available in the core Symfony Framework, check
out :doc:`/reference/dic_tags`.
out :doc:`/reference/dic_tags`. Each of these has a different effect on your
service and many tags require additional arguments (beyond just the ``name``
parameter).

Debugging Services
------------------
Expand Down
8 changes: 4 additions & 4 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1036,14 +1036,14 @@ stylesheets and JavaScripts that you'll need throughout your site:
{# ... #}

{% block stylesheets %}
<link href="{{ asset('/css/main.css') }}" rel="stylesheet" />
<link href="{{ asset('css/main.css') }}" rel="stylesheet" />
{% endblock %}
</head>
<body>
{# ... #}

{% block javascripts %}
<script src="{{ asset('/js/main.js') }}"></script>
<script src="{{ asset('js/main.js') }}"></script>
{% endblock %}
</body>
</html>
Expand All @@ -1061,7 +1061,7 @@ page. From inside that contact page's template, do the following:
{% block stylesheets %}
{{ parent() }}

<link href="{{ asset('/css/contact.css') }}" rel="stylesheet" />
<link href="{{ asset('css/contact.css') }}" rel="stylesheet" />
{% endblock %}

{# ... #}
Expand Down Expand Up @@ -1326,7 +1326,7 @@ covered:
{% endfor %}
{% endblock %}

Notice that this template extends the section template -(``AcmeBlogBundle::layout.html.twig``)
Notice that this template extends the section template (``AcmeBlogBundle::layout.html.twig``)
which in-turn extends the base application layout (``::base.html.twig``).
This is the common three-level inheritance model.

Expand Down
9 changes: 5 additions & 4 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ use somewhere in your application::
}

Add constraints though any of the supported methods. Set the message option to the
translation source text. For example, to guarantee that the $name property is not
empty, add the following:
translation source text. For example, to guarantee that the ``$name`` property is
not empty, add the following:

.. configuration-block::

Expand Down Expand Up @@ -646,8 +646,8 @@ Translating Database Content
----------------------------

The translation of database content should be handled by Doctrine through
the `Translatable Extension`_. For more information, see the documentation
for that library.
the `Translatable Extension`_ or the `Translatable Bahavior`_ (PHP 5.4+).
For more information, see the documentation for thes libraries.

Summary
-------
Expand All @@ -672,3 +672,4 @@ steps:
.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
.. _`ISO 639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _`Translatable Extension`: https://github.com/l3pp4rd/DoctrineExtensions
.. _`Translatable Bahavior`: https://github.com/KnpLabs/DoctrineBehaviors
4 changes: 2 additions & 2 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -985,9 +985,9 @@ entity and a new constraint group called ``Premium``:
Acme\DemoBundle\Entity\User:
properties:
name:
- NotBlank
- NotBlank: ~
creditCard:
- CardScheme
- CardScheme:
schemes: [VISA]
groups: [Premium]
Expand Down
2 changes: 1 addition & 1 deletion components/console/helpers/dialoghelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ from the command line, you need to overwrite the HelperSet used by the command::
return $stream;
}

By setting the inputStream of the ``DialogHelper``, you imitate what the
By setting the input stream of the ``DialogHelper``, you imitate what the
console would do internally with all user input through the cli. This way
you can test any user interaction (even complex ones) by passing an appropriate
input stream.
2 changes: 1 addition & 1 deletion components/console/helpers/tablehelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ When building a console application it may be useful to display tabular data:

.. image:: /images/components/console/table.png

To display table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`,
To display a table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`,
set headers, rows and render::

$table = $app->getHelperSet()->get('table');
Expand Down
12 changes: 6 additions & 6 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ verbosity levels::
}

When the quiet level is used, all output is suppressed as the default
:method:`Symfony\Component\Console\Output::write <Symfony\\Component\\Console\\Output\\Output::write>`
method returns without actually printing.
:method:`Symfony\\Component\\Console\\Output\\Output::write` method returns
without actually printing.

.. tip::

Expand Down Expand Up @@ -321,13 +321,13 @@ Unlike arguments, options are not ordered (meaning you can specify them in any
order) and are specified with two dashes (e.g. ``--yell`` - you can also
declare a one-letter shortcut that you can call with a single dash like
``-y``). Options are *always* optional, and can be setup to accept a value
(e.g. ``dir=src``) or simply as a boolean flag without a value (e.g.
``yell``).
(e.g. ``--dir=src``) or simply as a boolean flag without a value (e.g.
``--yell``).

.. tip::

It is also possible to make an option *optionally* accept a value (so that
``--yell`` or ``yell=loud`` work). Options can also be configured to
``--yell`` or ``--yell=loud`` work). Options can also be configured to
accept an array of values.

For example, add a new option to the command that can be used to specify
Expand Down Expand Up @@ -379,7 +379,7 @@ Option Value
InputOption::VALUE_IS_ARRAY This option accepts multiple values (e.g. ``--dir=/foo --dir=/bar``)
InputOption::VALUE_NONE Do not accept input for this option (e.g. ``--yell``)
InputOption::VALUE_REQUIRED This value is required (e.g. ``--iterations=5``), the option itself is still optional
InputOption::VALUE_OPTIONAL This option may or may not have a value (e.g. ``yell`` or ``yell=loud``)
InputOption::VALUE_OPTIONAL This option may or may not have a value (e.g. ``--yell`` or ``--yell=loud``)
=========================== =====================================================================================

You can combine ``VALUE_IS_ARRAY`` with ``VALUE_REQUIRED`` or ``VALUE_OPTIONAL`` like this:
Expand Down
14 changes: 13 additions & 1 deletion components/dependency_injection/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ service by asking for the ``bar`` service like this::

$container->get('bar'); // Would return the foo service

.. tip::

In YAML, you can also use a shortcut to alias a service:

.. code-block:: yaml
services:
foo:
class: Example\Foo
bar: "@foo"
Requiring files
---------------

Expand Down Expand Up @@ -169,5 +181,5 @@ the service itself gets loaded. To do so, you can use the ``file`` directive.
$definition->setFile('%kernel.root_dir%/src/path/to/file/foo.php');
$container->setDefinition('foo', $definition);
Notice that Symfony will internally call the PHP function require_once
Notice that Symfony will internally call the PHP statement ``require_once``,
which means that your file will be included only once per request.
2 changes: 1 addition & 1 deletion components/dependency_injection/definitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Add a method call with::

$definition->addMethodCall($method, $arguments);

Where ``$method`` is the method name and $arguments is an array of the arguments
Where ``$method`` is the method name and ``$arguments`` is an array of the arguments
to call the method with. The arguments can be strings, arrays, parameters or
service ids as with the constructor arguments.

Expand Down
4 changes: 2 additions & 2 deletions components/dependency_injection/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The DependencyInjection Component
the way objects are constructed in your application.

For an introduction to Dependency Injection and service containers see
:doc:`/book/service_container`
:doc:`/book/service_container`.

Installation
------------
Expand Down Expand Up @@ -181,7 +181,7 @@ Setting Up the Container with Configuration Files
As well as setting up the services using PHP as above you can also use
configuration files. This allows you to use XML or YAML to write the definitions
for the services rather than using PHP to define the services as in the above
examples. In anything but the smallest applications it make sense to organize
examples. In anything but the smallest applications it makes sense to organize
the service definitions by moving them into one or more configuration files.
To do this you also need to install
:doc:`the Config component </components/config/introduction>`.
Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/parentservices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The service config for these classes would look something like this:
- [setEmailFormatter, ["@my_email_formatter"]]
greeting_card_manager:
class: "%greeting_card_manager.class%"
class: "%greeting_card_manager.class%"
calls:
- [setMailer, ["@my_mailer"]]
- [setEmailFormatter, ["@my_email_formatter"]]
Expand Down
12 changes: 12 additions & 0 deletions components/dependency_injection/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,18 @@ To answer this, change the service declaration:
<tag name="acme_mailer.transport" alias="bar" />
</service>
.. code-block:: php
use Symfony\Component\DependencyInjection\Definition;
$definitionSmtp = new Definition('\Swift_SmtpTransport', array('%mailer_host%'));
$definitionSmtp->addTag('acme_mailer.transport', array('alias' => 'foo'));
$container->setDefinition('acme_mailer.transport.smtp', $definitionSmtp);
$definitionSendmail = new Definition('\Swift_SendmailTransport');
$definitionSendmail->addTag('acme_mailer.transport', array('alias' => 'bar'));
$container->setDefinition('acme_mailer.transport.sendmail', $definitionSendmail);
Notice that you've added a generic ``alias`` key to the tag. To actually
use this, update the compiler::

Expand Down
4 changes: 2 additions & 2 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ If you need to get full access to parsed data from ``Accept``, ``Accept-Language
$quality = $item->getQuality();
}

// accepts items are sorted by descending quality
// Accept header items are sorted by descending quality
$accepts = AcceptHeader::fromString($request->headers->get('Accept'))
->all();

Expand Down Expand Up @@ -423,7 +423,7 @@ method::
$response->send();
}

If the Response is not modified, it sets the status code to 304 and remove the
If the Response is not modified, it sets the status code to 304 and removes the
actual response content.

Redirecting the User
Expand Down
2 changes: 1 addition & 1 deletion components/property_access/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ You can also mix objects and arrays::

public function setChildren($children)
{
return $this->children;
$this->children = $children;
}

public function getChildren()
Expand Down
10 changes: 5 additions & 5 deletions components/routing/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ Defining routes
A full route definition can contain up to seven parts:

1. The URL path route. This is matched against the URL passed to the `RequestContext`,
and can contain named wildcard placeholders (e.g. ``{placeholders}``)
to match dynamic parts in the URL.
and can contain named wildcard placeholders (e.g. ``{placeholders}``)
to match dynamic parts in the URL.

2. An array of default values. This contains an array of arbitrary values
that will be returned when the request matches the route.
that will be returned when the request matches the route.

3. An array of requirements. These define constraints for the values of the
placeholders as regular expressions.
placeholders as regular expressions.

4. An array of options. These contain internal settings for the route and
are the least commonly needed.
are the least commonly needed.

5. A host. This is matched against the host of the request. See
:doc:`/components/routing/hostname_pattern` for more details.
Expand Down
2 changes: 1 addition & 1 deletion components/translation/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The second step is done by creating message catalogs that define the translation
for any number of different locales.

Creating Translations
=====================
---------------------

The act of creating translation files is an important part of "localization"
(often abbreviated `L10n`_). Translation files consist of a series of
Expand Down
2 changes: 1 addition & 1 deletion contributing/code/bc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Symfony's classes:
Type of Change Regular API
================================================== ============== ==============
Remove entirely No No
Make final Yes [2]_ No
Make final No No
Make abstract No No
Change name or namespace No No
Change parent class Yes [7]_ Yes [7]_
Expand Down
2 changes: 1 addition & 1 deletion cookbook/bundles/inheritance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ things like controllers, templates, and other files in a bundle's

For example, suppose that you're installing the `FOSUserBundle`_, but you
want to override its base ``layout.html.twig`` template, as well as one of
its controllers. Suppose also that you have your own ``AcmeUserBundle``
its controllers. Suppose also that you have your own AcmeUserBundle
where you want the overridden files to live. Start by registering the FOSUserBundle
as the "parent" of your bundle::

Expand Down
Loading

0 comments on commit d6a17e7

Please # to comment.