Skip to content

Commit

Permalink
Merge branch '2.5' into 2.6
Browse files Browse the repository at this point in the history
* 2.5:
  Fixed typos
  Update web_server_configuration.rst
  Update web_server_configuration.rst
  remove service class parameters
  Some fixes
  backport service factory improvements
  Minor standard fix for best practices guide
  Minor tweak
  Don't use form() helper
  Apply best practices to forms
  Use AppBundle instead of AcmeStoreBundle
  Other minor fixes
  Use AppBundle instead of AcmeDemoBundle
  link to a bundle's current (not master) docs
  finish #3744
  [WIP] - Console add Console arguments page
  Added a little sample on Option uses with "spaces"

Conflicts:
	book/forms.rst
	components/dependency_injection/factories.rst
	cookbook/profiler/matchers.rst
	cookbook/security/securing_services.rst
  • Loading branch information
weaverryan committed Dec 7, 2014
2 parents 3b9d60d + 06bc489 commit 6e23bc7
Show file tree
Hide file tree
Showing 25 changed files with 379 additions and 477 deletions.
7 changes: 2 additions & 5 deletions best_practices/business-logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,9 @@ the class namespace as a parameter:
# app/config/services.yml
# service definition with class namespace as parameter
parameters:
slugger.class: AppBundle\Utils\Slugger
services:
app.slugger:
class: "%slugger.class%"
class: AppBundle\Utils\Slugger
This practice is cumbersome and completely unnecessary for your own services:

Expand Down Expand Up @@ -335,7 +332,7 @@ in a matter of seconds.

.. _`full definition`: http://en.wikipedia.org/wiki/Business_logic
.. _`Doctrine project`: http://www.doctrine-project.org/
.. _`fixture class`: http://symfony.com/doc/master/bundles/DoctrineFixturesBundle/index.html#writing-simple-fixtures
.. _`fixture class`: http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html#writing-simple-fixtures
.. _`PSR-1`: http://www.php-fig.org/psr/psr-1/
.. _`PSR-2`: http://www.php-fig.org/psr/psr-2/
.. _`the Symfony Code Standards`: http://symfony.com/doc/current/contributing/code/standards.html
Expand Down
12 changes: 3 additions & 9 deletions best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ Building Forms
The Form component allows you to build forms right inside your controller
code. Honestly, unless you need to reuse the form somewhere else, that's
totally fine. But for organize and reuse, we recommend that you define each
form in its own PHP class:

.. code-block:: php
form in its own PHP class::

namespace AppBundle\Form;

Expand Down Expand Up @@ -51,9 +49,7 @@ form in its own PHP class:
}
}

To use the class, use ``createForm`` and instantiate the new class:

.. code-block:: php
To use the class, use ``createForm`` and instantiate the new class::

use AppBundle\Form\PostType;
// ...
Expand Down Expand Up @@ -110,9 +106,7 @@ directly in your form class, this would effectively limit the scope of that form
This form *may* have been designed for creating posts, but if you wanted
to reuse it for editing posts, the button label would be wrong. Instead,
some developers configure form buttons in the controller:

.. code-block:: php
some developers configure form buttons in the controller::

namespace AppBundle\Controller\Admin;

Expand Down
6 changes: 4 additions & 2 deletions best_practices/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Authorization (i.e. Denying Access)
Symfony gives you several ways to enforce authorization, including the ``access_control``
configuration in :doc:`security.yml </reference/configuration/security>` the
:ref:`@Security annotation <best-practices-security-annotation>` and using
:ref:`isGranted <best-practices-directy-isGranted>` on the ``security.context``
:ref:`isGranted <best-practices-directly-isGranted>` on the ``security.context``
service directly.

.. best-practice::
Expand Down Expand Up @@ -206,7 +206,7 @@ Now you can reuse this method both in the template and in the security expressio
<a href=""> ... </a>
{% endif %}

.. _best-practices-directy-isGranted:
.. _best-practices-directly-isGranted:

Checking Permissions without @Security
--------------------------------------
Expand Down Expand Up @@ -352,5 +352,7 @@ develop :doc:`your own user provider </cookbook/security/custom_provider>` and

.. _`ParamConverter`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
.. _`@Security annotation`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/security.html
.. _`security voter`: http://symfony.com/doc/current/cookbook/security/voters_data_permission.html
.. _`ACL's`: http://symfony.com/doc/current/cookbook/security/acl.html
.. _`expression`: http://symfony.com/doc/current/components/expression_language/introduction.html
.. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle
Loading

0 comments on commit 6e23bc7

Please sign in to comment.