Skip to content
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

2.3 #5569

Closed
wants to merge 17 commits into from
Closed

2.3 #5569

Show file tree
Hide file tree
Changes from 11 commits
Commits
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
6 changes: 2 additions & 4 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,6 @@ To relate the ``Category`` and ``Product`` entities, start by creating a
products:
targetEntity: Product
mappedBy: category
# don't forget to init the collection in the __construct() method
# of the entity

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is kind of usefull (and not everyone uses doctrine:generate:entities, even more it's better to never use this command).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, then please change it to:
The ArrayCollection $products is automatically initialized in the __construct() method, when you call doctrine:generate:entities

.. code-block:: xml

Expand Down Expand Up @@ -1094,7 +1092,7 @@ table, and ``product.category_id`` column, and new foreign key:

.. note::

This task should only be really used during development. For a more robust
This command should only be used during development. For a more robust
method of systematically updating your production database, read about
`migrations`_.

Expand Down Expand Up @@ -1185,7 +1183,7 @@ You can also query in the other direction::
// ...
}

In this case, the same things occurs: you first query out for a single ``Category``
In this case, the same things occur: you first query out for a single ``Category``
object, and then Doctrine makes a second query to retrieve the related ``Product``
objects, but only once/if you ask for them (i.e. when you call ``->getProducts()``).
The ``$products`` variable is an array of all ``Product`` objects that relate
Expand Down
2 changes: 1 addition & 1 deletion book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ from inside a controller::
->getForm();

return $this->render('default/new.html.twig', array(
'form' => $form->createView(),
'form' => $form->createView()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted to comply with the Symfony CS.

));
}
}
Expand Down
19 changes: 16 additions & 3 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ First, build a base layout file:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="UTF-8">
<title>{% block title %}Test Application{% endblock %}</title>
</head>
<body>
Expand All @@ -226,7 +226,7 @@ First, build a base layout file:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="UTF-8">
<title><?php $view['slots']->output('title', 'Test Application') ?></title>
</head>
<body>
Expand Down Expand Up @@ -311,7 +311,7 @@ output might look like this:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="UTF-8">
<title>My cool blog posts</title>
</head>
<body>
Expand Down Expand Up @@ -370,6 +370,19 @@ When working with template inheritance, here are some tips to keep in mind:
{{ parent() }}
{% endblock %}

* Blocks can be nested. For better overview, you can add the block name to the
``{% endblock %}`` tag like so:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say "like this".


.. code-block:: html+jinja

{% block foo %}
{# ... #}
{% block bar %}
{# ... #}
{% endblock bar %}
{# ... #}
{% endblock foo %}

.. index::
single: Templating; Naming conventions
single: Templating; File locations
Expand Down