Skip to content

Commit

Permalink
Merge branch '2.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Apr 7, 2015
2 parents e84182d + 56a80f8 commit c4e07cc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion best_practices/creating-the-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ProductBundle, InvoiceBundle, etc.

But a bundle is *meant* to be something that can be reused as a stand-alone
piece of software. If UserBundle cannot be used *"as is"* in other Symfony
apps, then it shouldn't be its own bundle. Moreover InvoiceBundle depends on
apps, then it shouldn't be its own bundle. Moreover, if InvoiceBundle depends on
ProductBundle, then there's no advantage to having two separate bundles.

.. best-practice::
Expand Down
12 changes: 7 additions & 5 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Controller
==========

A controller is a PHP callable you create that takes information from the
HTTP request and constructs and returns an HTTP response (as a Symfony
HTTP request and creates and returns an HTTP response (as a Symfony
``Response`` object). The response could be an HTML page, an XML document,
a serialized JSON array, an image, a redirect, a 404 error or anything else
you can dream up. The controller contains whatever arbitrary logic *your
Expand Down Expand Up @@ -34,7 +34,7 @@ common examples:
for the homepage of the site.

* *Controller B* reads the ``slug`` parameter from the request to load a
blog entry from the database and create a ``Response`` object displaying
blog entry from the database and creates a ``Response`` object displaying
that blog. If the ``slug`` can't be found in the database, it creates and
returns a ``Response`` object with a 404 status code.

Expand Down Expand Up @@ -201,7 +201,7 @@ to the controller:
return $collection;
Now, you can go to ``/hello/ryan`` (e.g. ``http://localhost:8000/app_dev.php/hello/ryan``
Now, you can go to ``/hello/ryan`` (e.g. ``http://localhost:8000/hello/ryan``
if you're using the :doc:`built-in web server </cookbook/web_server/built_in>`)
and Symfony will execute the ``HelloController::indexAction()`` controller
and pass in ``ryan`` for the ``$name`` variable. Creating a "page" means
Expand Down Expand Up @@ -490,7 +490,9 @@ You can also put templates in deeper sub-directories. Just try to avoid creating
unnecessarily deep structures::

// renders app/Resources/views/hello/greetings/index.html.twig
return $this->render('hello/greetings/index.html.twig', array('name' => $name));
return $this->render('hello/greetings/index.html.twig', array(
'name' => $name
));

The Symfony templating engine is explained in great detail in the
:doc:`Templating </book/templating>` chapter.
Expand Down Expand Up @@ -525,7 +527,7 @@ via the ``get()`` method. Here are several common services you might need::

$mailer = $this->get('mailer');

What other services exist? You can list all services, use the ``debug:container``
What other services exist? To list all services, use the ``debug:container``
console command:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion cookbook/form/data_transformers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ by calling ``addModelTransformer`` (or ``addViewTransformer`` - see

// the "em" is an option that you pass when creating your form. Check out
// the 3rd argument to createForm in the next code block to see how this
// is passed to the form (also see setDefaultOptions).
// is passed to the form (see also configureOptions).
$entityManager = $options['em'];
$transformer = new IssueToNumberTransformer($entityManager);

Expand Down
4 changes: 2 additions & 2 deletions cookbook/security/entity_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ interface requires three methods: ``loadUserByUsername($username)``,
->setParameter('username', $username)
->setParameter('email', $username)
->getQuery()
->getOneOrNullResult()
->getOneOrNullResult();

if ($user) {
if (null === $user) {
$message = sprintf(
'Unable to find an active admin AppBundle:User object identified by "%s".',
$username
Expand Down
16 changes: 8 additions & 8 deletions cookbook/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ Here is an example on how to load the

.. code-block:: yaml
# app/config/config.yml
services:
get_set_method_normalizer:
class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
tags:
- { name: serializer.normalizer }
# app/config/services.yml
services:
get_set_method_normalizer:
class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
tags:
- { name: serializer.normalizer }
.. code-block:: xml
<!-- app/config/config.xml -->
<!-- app/config/services.xml -->
<services>
<service id="get_set_method_normalizer" class="Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer">
<tag name="serializer.normalizer" />
Expand All @@ -92,7 +92,7 @@ Here is an example on how to load the
.. code-block:: php
// app/config/config.php
// app/config/services.php
use Symfony\Component\DependencyInjection\Definition;
$definition = new Definition(
Expand Down

0 comments on commit c4e07cc

Please sign in to comment.