Skip to content

Reorder page from simple to advanced #3910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 215 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
10fe8a4
Removed 2.2 references as it reached eom
wouterj Nov 2, 2013
9d4a138
Merge branch 'master' into eom-2-2
weaverryan Dec 8, 2013
2f486ce
[Security][Acl] Documentation for the new updateUserSecurityIdentity …
lemoinem Dec 12, 2013
a7b80a6
[Form] added multiple option to file type doc
bamarni Dec 17, 2013
bf98517
fixed spaces
bamarni Dec 17, 2013
cc5c9a3
Merge branch '2.4'
weaverryan Dec 17, 2013
06f2f74
Merge pull request #3319 from lemoinem/features/acl-update-security-id
weaverryan Dec 23, 2013
2a10a46
[#3319] Linking to the whole method
weaverryan Dec 23, 2013
1401372
Merge branch '2.4'
weaverryan Dec 23, 2013
34551d2
[#3319] Fixing typos thanks to @xabbuh
weaverryan Dec 26, 2013
d31465b
Merge branch '2.4'
weaverryan Dec 26, 2013
6bdcdb1
Merge pull request #3354 from bamarni/patch-6
weaverryan Dec 26, 2013
6b7d307
Merge branch '2.4'
weaverryan Dec 26, 2013
6c3d9eb
Merge branch '2.4'
fabpot Dec 27, 2013
7112444
Merge branch '2.4'
weaverryan Jan 1, 2014
bd1e53e
Revert "[#3338] Removing delete_empty details because this is first b…
weaverryan Jan 1, 2014
42084dd
[#3338] Adding versionadded
weaverryan Jan 1, 2014
8735384
Merge branch '2.4'
weaverryan Jan 1, 2014
d5fe901
Merge branch '2.4'
weaverryan Jan 2, 2014
33d27cc
[#3362] Updating composer install version on the master branch
weaverryan Jan 2, 2014
b1e0886
Merge branch '2.4'
weaverryan Jan 2, 2014
bfe3a20
[Validation] Add "hasser" support
bicpi Jan 4, 2014
bb9004e
Add "versionadded" directive for 2.5
bicpi Jan 4, 2014
b29ab89
Documented the Change the Default Command in the Console component
dcsg Jan 4, 2014
b9f8b8d
fix "versionadded" wording
bicpi Jan 5, 2014
11c7174
Added the version number where the setDefaultCommand was introduced
dcsg Jan 5, 2014
60e2b3e
Added the delete document to avoid broken urls and added a notice that
dcsg Jan 5, 2014
af9eac4
Changed the code to remove references to Symfony Framework since it's
dcsg Jan 5, 2014
730985f
Updated references to the new document
dcsg Jan 5, 2014
012456d
Moved `versionadded` to the right section
dcsg Jan 5, 2014
c23f34e
Applied some suggestions
dcsg Jan 5, 2014
94fe8dc
Add info about callback in options resolver
marekkalnik Jan 6, 2014
0f90fed
Merge branch '2.4'
weaverryan Jan 7, 2014
5e97202
Applyed suggestions from @fabpot and @stof
dcsg Jan 7, 2014
fdf4891
Documented deprecation of the apache router.
jakzal Jan 8, 2014
c1b2aad
Applied suggestions from Ryan
dcsg Jan 9, 2014
6db5f23
feature #3426 New Feature: Change the Default Command in the Console …
weaverryan Jan 9, 2014
faa034b
[WIP][Valiadtor] - EmailConstraint reference
egulias Jan 12, 2014
e4a0e2f
Use of Sphinx markup
egulias Jan 12, 2014
f0b3b85
Version added and clarifications
egulias Jan 12, 2014
517e4c5
Link moved and heading updated
egulias Jan 12, 2014
cce3b40
fixed typo
dcsg Jan 12, 2014
8beb570
Fixed `versionadded` inconsistencies
dcsg Jan 12, 2014
aa5aa61
Typo and link label
egulias Jan 12, 2014
8231230
Fix according to PR comments
marekkalnik Jan 13, 2014
a0dd460
Lowercase and link label
egulias Jan 13, 2014
c50f041
CS
egulias Jan 16, 2014
6fd3f93
Documenting createAccessDeniedException() method
klaussilveira Jan 17, 2014
53f156c
Updating references to match doc format
klaussilveira Jan 17, 2014
b1b9090
Adding versionadded detail
klaussilveira Jan 17, 2014
da6002d
Wrapping line
klaussilveira Jan 17, 2014
257c483
Blank line restored
egulias Jan 18, 2014
8cd63d0
Added feature doc for named encoders
tamirvs Jan 18, 2014
c6ac96c
Merge branch '2.4'
weaverryan Jan 20, 2014
0a0bf4c
feature #3437 Add info about callback in options resolver (marekkalnik)
weaverryan Jan 21, 2014
11e079b
feature #3446 [WCM] Documented deprecation of the apache router. (jak…
weaverryan Jan 21, 2014
b6abafb
[#3446] Minor tweaks as suggested by @xabbuh
weaverryan Jan 21, 2014
a87fe18
bug #3470 Fixed typo (danielcsgomes)
weaverryan Jan 21, 2014
2746067
minor #3472 Fixed `versionadded` inconsistencies in Symfony 2.5+ (dan…
weaverryan Jan 21, 2014
8bd668e
Merge branch '2.4'
weaverryan Jan 22, 2014
6058408
Merge branch '2.4'
weaverryan Feb 1, 2014
46377b2
feature #3486 Documenting createAccessDeniedException() method (klaus…
weaverryan Feb 2, 2014
8ccfe85
feature #3491 Added feature doc for named encoders (tamirvs)
weaverryan Feb 3, 2014
2fbf17c
[#3491] Moving the new named algorithms into their own cookbook entry…
weaverryan Feb 3, 2014
34e69de
[#3533] Lots of nice changes thanks to @xabbuh
weaverryan Feb 4, 2014
7e75b64
minor #3533 Moving the new named algorithms into their own cookbook e…
weaverryan Feb 4, 2014
bdc6c3f
Merge branch '2.4'
weaverryan Feb 4, 2014
2ca9bd5
Describe retrieval of StopwatchEvent
jochenvdv Feb 4, 2014
64602c8
fix referenced documents names
xabbuh Feb 5, 2014
7e3c0e3
readd configuration block
xabbuh Feb 5, 2014
46e0b52
remove empty_data from the list of inherited options, it's documented…
xabbuh Feb 5, 2014
642e776
bug #3544 Fix build errors (xabbuh)
weaverryan Feb 11, 2014
2cb2c2d
Merge branch '2.4'
weaverryan Feb 18, 2014
cadca3b
Merge branch '2.4'
weaverryan Feb 20, 2014
eefd0ab
add versionadded directive for multiple option
xabbuh Feb 25, 2014
f4afaab
Documentation for the new Uuid constraint
colinodell Feb 28, 2014
3ea9137
List the UUID constraint in the reference section
colinodell Feb 28, 2014
6f6c03f
Fix formatting issues
colinodell Feb 28, 2014
bd9cd26
added docs for the new Table console helper
fabpot Mar 3, 2014
9e2727d
added documentation for the new Symfony 2.5 progress bar
fabpot Mar 3, 2014
2d9647b
Added documentation for translation:debug
florianv Mar 3, 2014
8903e23
Merge branch '2.4'
weaverryan Mar 4, 2014
6adf160
Added documentation about new requests formats configuration
gquemener Dec 31, 2013
6c52b92
[#3311] Use KernelTestCase instead of WebTestCase for tests needing o…
johnkary Nov 30, 2013
5cda1c7
feature #3311 Use KernelTestCase instead of WebTestCase for testing c…
weaverryan Mar 5, 2014
e33be6d
Merge branch '2.4'
weaverryan Mar 7, 2014
0a65b6f
minor #3608 [Reference][Forms] add versionadded directive for multipl…
weaverryan Mar 8, 2014
8eaf232
Merge branch '2.4'
weaverryan Mar 10, 2014
6c7cb88
Merge branch '2.4'
wouterj Mar 10, 2014
153f97f
Added 2.5 CHANGELOG
wouterj Mar 10, 2014
96bd81b
feature #3626 added documentation for the new Symfony 2.5 progress ba…
weaverryan Mar 11, 2014
876a55d
Merge remote-tracking branch 'origin/master'
weaverryan Mar 11, 2014
7eb3051
Fixed syntax highlighting
rvanlaarhoven Mar 12, 2014
484b7b9
Added :
rvanlaarhoven Mar 12, 2014
df63740
feature #3627 added docs for the new Table console helper (fabpot)
weaverryan Mar 12, 2014
857725b
Merge branch '2.4'
weaverryan Mar 12, 2014
864b9f2
Merge branch 'master' of github.com:symfony/symfony-docs into transla…
florianv Mar 13, 2014
38b2955
Improved the documentation with examples and images
florianv Mar 13, 2014
739f43f
minor #3669 Fixed syntax highlighting (rvanlaarhoven)
weaverryan Mar 13, 2014
b6ac454
Fixed the issues
florianv Mar 13, 2014
37278d8
remove unnecessary code block directive
xabbuh Mar 13, 2014
17166bd
First shot of a documentation of the new PSR-4 class loader.
derrabus Mar 12, 2014
6f2a1a3
Adjustments from comments be @WouterJ
derrabus Mar 16, 2014
a05da41
Minor corrections.
derrabus Mar 17, 2014
16fead4
Adjustments from comments by @bicpi
derrabus Mar 17, 2014
cb2be4a
Moved versionadded block to the top.
derrabus Mar 17, 2014
4dde2ca
[Process] Add doc for Process::disableOutput and Process::enableOutput
romainneutron Mar 12, 2014
5b915c2
feature #3629 Added documentation for translation:debug (florianv)
weaverryan Mar 17, 2014
bd947c7
[TwigBundle] Add documentation about generating absolute URL with the…
romainneutron Mar 14, 2014
cd6d1de
minor #3676 remove unnecessary code block directive (xabbuh)
weaverryan Mar 18, 2014
3731e2e
feature #3686 Documentation of the new PSR-4 class loader. (derrabus)
weaverryan Mar 18, 2014
fc1576a
feature #3664 [Process] Add doc for Process::disableOutput and Proces…
weaverryan Mar 18, 2014
842fd30
feature #3683 [TwigBundle] Add documentation about generating absolut…
weaverryan Mar 18, 2014
dcf8e6e
feature #3402 Added documentation about new requests formats configur…
weaverryan Mar 18, 2014
8673b59
Merge branch '2.4'
weaverryan Mar 18, 2014
a6a074c
fixing a code block
xabbuh Mar 18, 2014
27b3410
minor #3692 [Book][Translations] fixing a code block (xabbuh)
weaverryan Mar 18, 2014
5fb6d21
Merge branch '2.4'
weaverryan Mar 18, 2014
eafbab1
Enhanced Firewall Restrictions docs
Mar 18, 2014
2f3f88b
Merge branch '2.4'
weaverryan Mar 19, 2014
450146e
feature #3681 Enhanced Firewall Restrictions docs (danez)
weaverryan Mar 19, 2014
e40733d
Merge branch '2.4'
weaverryan Mar 19, 2014
0816a07
[Console] Change Command namespaces
dunglas Mar 19, 2014
15a9d25
minor #3697 [Console] Change Command namespaces (dunglas)
weaverryan Mar 20, 2014
a12aa41
Merge branch '2.4'
weaverryan Mar 20, 2014
ddf5fe4
add firewall restriction document to security toctree
xabbuh Mar 20, 2014
70b55b5
fix literal
xabbuh Mar 20, 2014
955526c
Merge branch '2.4'
wouterj Mar 22, 2014
15628e6
[Console] Added standalone PSR-3 compliant logger
dunglas Mar 19, 2014
1908a15
feature #3696 [Console] Added standalone PSR-3 compliant logger (dung…
weaverryan Mar 24, 2014
db1cda5
minor #3700 [Cookbook][Security] Firewall restrictions tweaks (xabbuh)
weaverryan Mar 24, 2014
72d40a8
Merge branch '2.4'
weaverryan Mar 24, 2014
ac484f4
Made suggested tweaks
jochenvdv Mar 25, 2014
295f109
Add reason for getEvent()
jochenvdv Mar 25, 2014
0ee15d3
Fix versionadded
jochenvdv Mar 25, 2014
239b1b6
Some markup fixes
wouterj Mar 25, 2014
b3372cf
Made versionadded consistent
wouterj Mar 25, 2014
8e6e550
Merge branch '2.4'
weaverryan Mar 26, 2014
c703549
Merge branch '2.4'
weaverryan Mar 26, 2014
4fd5fc1
feature #3539 [Stopwatch] Describe retrieval of StopwatchEvent (joche…
weaverryan Mar 26, 2014
4b611d6
minor #3717 [master] Fixed versionadded blocks (WouterJ)
weaverryan Mar 26, 2014
974cb18
Merge branch '2.4'
weaverryan Mar 26, 2014
dd16589
add logger chapter to the component's map
xabbuh Mar 26, 2014
9b0911b
fix grammer mistake
xabbuh Mar 26, 2014
3bbccf7
fix PSR-3 link as mentioned by @max-voloshin
xabbuh Mar 26, 2014
83adc87
fix class roles
xabbuh Mar 26, 2014
610eb6b
code fixes as mentioned by @dirkluijk
xabbuh Mar 26, 2014
cad38ae
bug #3721 tweaks to the Console logger (xabbuh)
weaverryan Mar 26, 2014
d7027c0
feature #3418 [Validation] Add "hasser" support (bicpi)
weaverryan Mar 26, 2014
b34fb64
feature #3619 [Validator] Uuid constraint reference (colinodell)
weaverryan Mar 26, 2014
119064d
Merge branch '2.4'
weaverryan Mar 27, 2014
80045df
Merge branch '2.4'
weaverryan Mar 27, 2014
bb8e3ed
Added documentation for the new PropertyAccessor::isReadable() and is…
webmozart Mar 28, 2014
a4ef0e1
Merge branch '2.4'
weaverryan Mar 31, 2014
ec3aaca
Merge branch '2.4'
weaverryan Apr 2, 2014
c062d81
feature #3469 [Validator] - EmailConstraint reference (egulias)
weaverryan Apr 2, 2014
d2faada
Merge branch '2.4'
weaverryan Apr 2, 2014
f6af251
[Templating] Add documentation about generating versioned URLs
romainneutron Mar 31, 2014
456da28
[Form] Deprecated max_length and pattern options
Jan 11, 2014
efbe0f3
Fixed a typo
gquemener Apr 3, 2014
1934720
feature #3461 [Form] Deprecated max_length and pattern options (stefa…
weaverryan Apr 7, 2014
c77835c
Merge branch '2.4'
weaverryan Apr 7, 2014
cedfdce
minor #3757 Fixed a typo in the request formats configuration page (g…
weaverryan Apr 7, 2014
f4ee337
[Console] Add documentation for QuestionHelper
romainneutron Apr 3, 2014
1705231
[Console] Add Process Helper documentation
romainneutron Apr 3, 2014
be4b9d3
feature #3729 Added documentation for the new PropertyAccessor::isRea…
weaverryan Apr 12, 2014
319bf29
[#3729] Making minor changes thansk to @WouterJ and @xabbuh.
weaverryan Apr 12, 2014
fb9fe99
[#3729] Removing 3rd argument to isWritable - this doesn't exist in t…
weaverryan Apr 12, 2014
64a924d
feature #3756 [WCM][Console] Add Process Helper documentation (romain…
weaverryan Apr 12, 2014
552c780
Revert "[Console] Add Process Helper documentation"
weaverryan Apr 12, 2014
9e129bc
feature #3752 [Console] Add documentation for QuestionHelper (romainn…
weaverryan Apr 12, 2014
eef3313
[#3752] Adding the question helper to the helper list and marking dia…
weaverryan Apr 12, 2014
b4a0fb0
Merge branch '2.4'
weaverryan Apr 12, 2014
98288fc
Updated changelog for March
wouterj Apr 13, 2014
c8bfde6
Merge branch '2.4'
weaverryan Apr 21, 2014
69b52c7
Merge branch '2.4'
weaverryan Apr 28, 2014
be6c79d
Merge branch '2.4'
weaverryan May 2, 2014
a9648e8
feature #3742 [2.5][Templating] Add documentation about generating ve…
weaverryan May 6, 2014
560e010
Adding more details to be clear that you can set asset version global…
weaverryan May 6, 2014
d6474fc
Merge branch '2.4'
weaverryan May 6, 2014
baa9759
bug #3791 Property access tweaks (weaverryan)
weaverryan May 6, 2014
5e7092f
Merge branch '2.4'
weaverryan May 6, 2014
c01e87c
Added April changelog
wouterj May 6, 2014
6d00c3d
[#3797] Reordered changelog
wouterj May 6, 2014
fe5a39f
fix literal positions
xabbuh May 9, 2014
0fe1bfd
Merge branch '2.4'
weaverryan May 9, 2014
3e3b79d
Merge branch '2.4'
weaverryan May 9, 2014
36f68b6
fix the wording in versionadded directives
xabbuh May 5, 2014
4eafdbd
[#3837] Fixes thanks to stof and WouterJ
weaverryan May 10, 2014
1aa79d5
minor #3834 fix the wording in versionadded directives (for the maste…
weaverryan May 10, 2014
681ddc8
minor #3843 [Changelog] fix literal positions (xabbuh)
weaverryan May 10, 2014
21a4b9d
Merge branch '2.4'
weaverryan May 10, 2014
00f60a8
minor #3837 More asset version details (weaverryan)
weaverryan May 12, 2014
b760612
Merge branch '2.4'
weaverryan May 12, 2014
6b56422
Merge branch '2.4'
weaverryan May 13, 2014
797cbd5
minor #3794 Adds link to new QuestionHelper (weaverryan)
weaverryan May 15, 2014
704d206
Merge branch '2.4'
weaverryan May 15, 2014
83bb723
Updated the installation instructions to Symfony 2.5+
javiereguiluz May 26, 2014
1f5d980
added a note about is* getters support with GetSetMethodNormalizer
Feb 24, 2014
f913dd7
feature #3603 [Serializer] Support for is.* getters in GetSetMethodNo…
weaverryan May 27, 2014
6c87f99
Merge branch '2.4' into 2.5
weaverryan May 27, 2014
e6bc038
Add documentation about service decoration
romainneutron Apr 3, 2014
4fd1b49
feature #3753 [DependencyInjection] Add documentation about service d…
weaverryan May 29, 2014
564f60d
Fixed link.
aitboudad May 25, 2014
3e3004f
minor #3865 Fixed link. (aitboudad)
weaverryan May 29, 2014
9a533ce
Merge branch '2.4' into 2.5
weaverryan May 29, 2014
eadf281
feature #3874 Updated the installation instructions for Symfony 2.5+ …
weaverryan Jun 4, 2014
47ce3f1
Fixed syntax
wouterj Jun 6, 2014
bfd8488
Merge branch '2.4' into 2.5
weaverryan Jun 7, 2014
43ae4f1
Added May changelog
wouterj Jun 8, 2014
fb8a641
Reorder page from simple to advanced
clemens-tolboom Jun 6, 2014
b4d42c7
Fixed feedback from @xabbuh
clemens-tolboom Jun 6, 2014
4ba56c3
Fixed feedback from @xabbuh: Templates
clemens-tolboom Jun 6, 2014
8df5785
Added feedback from @weaverryan with a little move around.
clemens-tolboom Jun 8, 2014
ba19707
Fixed @weaverryan: backticks and rephase method overrides.
clemens-tolboom Jun 9, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,8 @@ the correct values of a number of field options.
(i.e. is the field ``nullable``). This is very useful, as your client-side
validation will automatically match your validation rules.

* ``max_length``: If the field is some sort of text field, then the ``max_length``
option can be guessed from the validation constraints (if ``Length`` or
* ``maxlength``: If the field is some sort of text field, then the ``maxlength``
option attribute can be guessed from the validation constraints (if ``Length`` or
``Range`` is used) or from the Doctrine metadata (via the field's length).

.. note::
Expand All @@ -721,7 +721,7 @@ the correct values of a number of field options.
If you'd like to change one of the guessed values, you can override it by
passing the option in the options field array::

->add('task', null, array('max_length' => 4))
->add('task', null, array('attr' => array('maxlength' => 4)))

.. index::
single: Forms; Rendering in a template
Expand Down Expand Up @@ -1899,7 +1899,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.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
.. _`Twig Bridge`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bridge/Twig
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/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.3/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form
.. _`view on GitHub`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form
2 changes: 1 addition & 1 deletion book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Distribution:

.. code-block:: bash

$ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.4.*
$ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony dev-master

.. tip::

Expand Down
14 changes: 0 additions & 14 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ The route is simple:

return $collection;

.. versionadded:: 2.2
The ``path`` option was introduced in Symfony 2.2, ``pattern`` is used
in older versions.

The path defined by the ``blog_show`` route acts like ``/blog/*`` where
the wildcard is given the name ``slug``. For the URL ``/blog/my-blog-post``,
the ``slug`` variable gets a value of ``my-blog-post``, which is available
Expand Down Expand Up @@ -706,10 +702,6 @@ be accomplished with the following route configuration:

return $collection;

.. versionadded:: 2.2
The ``methods`` option was introduced in Symfony 2.2. Use the ``_method``
requirement in older versions.

Despite the fact that these two routes have identical paths (``/contact``),
the first route will match only GET requests and the second route will match
only POST requests. This means that you can display the form and submit the
Expand All @@ -722,9 +714,6 @@ form via the same URL, while using distinct controllers for the two actions.
Adding a Host Requirement
~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.2
Host matching support was introduced in Symfony 2.2

You can also match on the HTTP *host* of the incoming request. For more
information, see :doc:`/components/routing/hostname_pattern` in the Routing
component documentation.
Expand Down Expand Up @@ -1166,9 +1155,6 @@ from the new routing resource.
Adding a Host Requirement to Imported Routes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.2
Host matching support was introduced in Symfony 2.2

You can set the host regex on imported routes. For more information, see
:ref:`component-routing-host-imported`.

Expand Down
26 changes: 15 additions & 11 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ can access ``/foo`` without being prompted to authenticate.

.. tip::

You can also match a request against other details of the request (e.g. host).
For more information and examples read :doc:`/cookbook/security/firewall_restriction`.
You can also match a request against other details of the request (e.g.
host, method). For more information and examples read
:doc:`/cookbook/security/firewall_restriction`.

.. image:: /images/book/security_anonymous_user_access.png
:align: center
Expand Down Expand Up @@ -1088,19 +1089,25 @@ fine-grained enough in certain cases. When necessary, you can easily force
authorization from inside a controller::

// ...
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

public function helloAction($name)
{
if (false === $this->get('security.context')->isGranted('ROLE_ADMIN')) {
throw new AccessDeniedException();
throw $this->createAccessDeniedException('Unable to access this page!');
}

// ...
}

.. _book-security-securing-controller-annotations:

.. versionadded:: 2.5
The ``createAccessDeniedException`` method was introduced in Symfony 2.5.

The :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::createAccessDeniedException`
method creates a special :class:`Symfony\\Component\\Security\\Core\Exception\\AccessDeniedException`
object, which ultimately triggers a 403 HTTP response inside Symfony.

Thanks to the SensioFrameworkExtraBundle, you can also secure your controller using annotations::

// ...
Expand Down Expand Up @@ -1444,9 +1451,10 @@ or via some online tool.
Supported algorithms for this method depend on your PHP version. A full list
is available by calling the PHP function :phpfunction:`hash_algos`.

.. versionadded:: 2.2
As of Symfony 2.2 you can also use the :ref:`PBKDF2 <reference-security-pbkdf2>`
password encoder.
.. tip::

It's also possible to use different hashing algorithms on a user-by-user
basis. See :doc:`/cookbook/security/named_encoders` for more details.

Determining the Hashed Password
...............................
Expand Down Expand Up @@ -2065,10 +2073,6 @@ cookie will be ever created by Symfony2):
Utilities
---------

.. versionadded:: 2.2
The ``StringUtils`` and ``SecureRandom`` classes were introduced in Symfony
2.2

The Symfony Security component comes with a collection of nice utilities related
to security. These utilities are used by Symfony, but you should also use
them if you want to solve the problem they address.
Expand Down
50 changes: 38 additions & 12 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,6 @@ When working with template inheritance, here are some tips to keep in mind:
Template Naming and Locations
-----------------------------

.. versionadded:: 2.2
Namespaced path support was introduced in 2.2, allowing for template names
like ``@AcmeDemo/layout.html.twig``. See :doc:`/cookbook/templating/namespaced_paths`
for more details.

By default, templates can live in two different locations:

* ``app/Resources/views/``: The applications ``views`` directory can contain
Expand Down Expand Up @@ -570,10 +565,6 @@ you set `with_context`_ to false).
maps (i.e. an array with named keys). If you needed to pass in multiple
elements, it would look like this: ``{'foo': foo, 'bar': bar}``.

.. versionadded:: 2.2
The `include() function`_ is a new Twig feature that's available in Symfony
2.2. Prior, the `{% include %} tag`_ tag was used.

.. index::
single: Templating; Embedding action

Expand Down Expand Up @@ -780,9 +771,6 @@ in your application configuration:
),
));

.. versionadded:: 2.2
Default templates per render function was introduced in Symfony 2.2

You can define default templates per ``render`` function (which will override
any global default template that is defined):

Expand Down Expand Up @@ -1001,6 +989,44 @@ assets won't be cached when deployed. For example, ``/images/logo.png`` might
look like ``/images/logo.png?v2``. For more information, see the :ref:`ref-framework-assets-version`
configuration option.

.. _`book-templating-version-by-asset`:

.. versionadded:: 2.5
Setting versioned URLs on an asset-by-asset basis was introduced in Symfony 2.5.

If you need to set a version for a specific asset, you can set the fourth
argument (or the ``version`` argument) to the desired version:

.. configuration-block::

.. code-block:: html+jinja

<img src="{{ asset('images/logo.png', version='3.0') }}" alt="Symfony!" />

.. code-block:: html+php

<img src="<?php echo $view['assets']->getUrl('images/logo.png', null, false, '3.0') ?>" alt="Symfony!" />

If you dont give a version or pass ``null``, the default package version
(from :ref:`ref-framework-assets-version`) will be used. If you pass ``false``,
versioned URL will be deactivated for this asset.

.. versionadded:: 2.5
Absolute URLs for assets were introduced in Symfony 2.5.

If you need absolute URLs for assets, you can set the third argument (or the
``absolute`` argument) to ``true``:

.. configuration-block::

.. code-block:: html+jinja

<img src="{{ asset('images/logo.png', absolute=true) }}" alt="Symfony!" />

.. code-block:: html+php

<img src="<?php echo $view['assets']->getUrl('images/logo.png', null, true) ?>" alt="Symfony!" />

.. index::
single: Templating; Including stylesheets and JavaScripts
single: Stylesheets; Including stylesheets
Expand Down
167 changes: 167 additions & 0 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,173 @@ The translation of database content should be handled by Doctrine through
the `Translatable Extension`_ or the `Translatable Behavior`_ (PHP 5.4+).
For more information, see the documentation for thes libraries.

Debugging Translations
----------------------

.. versionadded:: 2.5
The ``translation:debug`` command was introduced in Symfony 2.5.

When maintaining a bundle, you may use or remove the usage of a translation
message without updating all message catalogues. The ``translation:debug``
command helps you to find these missing or unused translation messages for a
given locale. It shows you a table with the result when translating the
message in the given locale and the result when the fallback would be used.
On top of that, it also shows you when the translation is the same as the
fallback translation (this could indicate that the message was not correctly
translated).

Thanks to the messages extractors, the command will detect the translation
tag or filter usages in Twig templates:

.. code-block:: jinja

{% trans %}Symfony2 is great{% endtrans %}

{{ 'Symfony2 is great'|trans }}

{{ 'Symfony2 is great'|transchoice(1) }}

{% transchoice 1 %}Symfony2 is great{% endtranschoice %}

It will also detect the following translator usages in PHP templates:

.. code-block:: php

$view['translator']->trans("Symfony2 is great");

$view['translator']->trans('Symfony2 is great');

.. caution::

The extractors are not able to inspect the messages translated outside templates which means
that translator usages in form labels or inside your controllers won't be detected.
Dynamic translations involving variables or expressions are not detected in templates,
which means this example won't be analyzed:

.. code-block:: jinja

{% set message = 'Symfony2 is great' %}
{{ message|trans }}

Suppose your application's default_locale is ``fr`` and you have configured ``en`` as the fallback locale
(see :ref:`book-translation-configuration` and :ref:`book-translation-fallback` for how to configure these).
And suppose you've already setup some translations for the ``fr`` locale inside an AcmeDemoBundle:

.. configuration-block::

.. code-block:: xml

<!-- src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.xliff -->
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>Symfony2 is great</source>
<target>J'aime Symfony2</target>
</trans-unit>
</body>
</file>
</xliff>

.. code-block:: php

// src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.php
return array(
'Symfony2 is great' => 'J\'aime Symfony2',
);

.. code-block:: yaml

# src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.yml
Symfony2 is great: J'aime Symfony2

and for the ``en`` locale:

.. configuration-block::

.. code-block:: xml

<!-- src/Acme/AcmeDemoBundle/Resources/translations/messages.en.xliff -->
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>Symfony2 is great</source>
<target>Symfony2 is great</target>
</trans-unit>
</body>
</file>
</xliff>

.. code-block:: php

// src/Acme/AcmeDemoBundle/Resources/translations/messages.en.php
return array(
'Symfony2 is great' => 'Symfony2 is great',
);

.. code-block:: yaml

# src/Acme/AcmeDemoBundle/Resources/translations/messages.en.yml
Symfony2 is great: Symfony2 is great

To inspect all messages in the ``fr`` locale for the AcmeDemoBundle, run:

.. code-block:: bash

$ php app/console translation:debug fr AcmeDemoBundle

You will get this output:

.. image:: /images/book/translation/debug_1.png
:align: center

It indicates that the message ``Symfony2 is great`` is unused because it is translated,
but you haven't used it anywhere yet.

Now, if you translate the message in one of your templates, you will get this output:

.. image:: /images/book/translation/debug_2.png
:align: center

The state is empty which means the message is translated in the ``fr`` locale and used in one or more templates.

If you delete the message ``Symfony2 is great`` from your translation file for the ``fr`` locale
and run the command, you will get:

.. image:: /images/book/translation/debug_3.png
:align: center

The state indicates the message is missing because it is not translated in the ``fr`` locale
but it is still used in the template.
Moreover, the message in the ``fr`` locale equals to the message in the ``en`` locale.
This is a special case because the untranslated message id equals its translation in the ``en`` locale.

If you copy the content of the translation file in the ``en`` locale, to the translation file
in the ``fr`` locale and run the command, you will get:

.. image:: /images/book/translation/debug_4.png
:align: center

You can see that the translations of the message are identical in the ``fr`` and ``en`` locales
which means this message was probably copied from French to English and maybe you forgot to translate it.

By default all domains are inspected, but it is possible to specify a single domain:

.. code-block:: bash

$ php app/console translation:debug en AcmeDemoBundle --domain=messages

When bundles have a lot of messages, it is useful to display only the unused
or only the missing messages, by using the ``--only-unused`` or ``--only-missing`` switches:

.. code-block:: bash

$ php app/console translation:debug en AcmeDemoBundle --only-unused
$ php app/console translation:debug en AcmeDemoBundle --only-missing

Summary
-------

Expand Down
Loading