From 870097596d416d49f93a86cc9db2451ddbeaffbb Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Sun, 28 Jun 2015 16:54:10 +0200 Subject: [PATCH 01/11] Changed to HTML5's | Q | A | ------------- | --- | Doc fix? | [yes] | New docs? | [no] | Applies to | [2.3] | Fixed tickets | [] --- book/templating.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/templating.rst b/book/templating.rst index 62500e250bb..5264ec95b7f 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -201,7 +201,7 @@ First, build a base layout file: - + {% block title %}Test Application{% endblock %} @@ -226,7 +226,7 @@ First, build a base layout file: - + <?php $view['slots']->output('title', 'Test Application') ?> @@ -311,7 +311,7 @@ output might look like this: - + My cool blog posts From 87e2c1e051d106e88506a67d134b9623137b3fcf Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 30 Jun 2015 12:29:36 +0200 Subject: [PATCH 02/11] Note about nesting blocks and {% endblock NAME %} | Q | A | ------------- | --- | Doc fix? | [yes] | New docs? | [yes] | Applies to | [2.3] | Fixed tickets | [] --- book/templating.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/book/templating.rst b/book/templating.rst index 62500e250bb..b1fa09bb865 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -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: + + .. code-block:: html+jinja + + {% block foo %} + {# ... #} + {% block bar %} + {# ... #} + {% endblock bar %} + {# ... #} + {% endblock foo %} + .. index:: single: Templating; Naming conventions single: Templating; File locations From 6ae94e9fd3525fd0ae90db7e7d0969f517c7061a Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 2 Jul 2015 10:36:28 +0200 Subject: [PATCH 03/11] Removed unnecessary(?) YAML hint | Q | A | ------------- | --- | Doc fix? | [yes] | New docs? | [no] | Applies to | [2.3] | Fixed tickets | [] I guess it's not necessary to do anything in __construct manually - the ArrayCollection is automatically initialized when you do php app/console doctrine:generate:entities AppBundle Please double-check! --- book/doctrine.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/book/doctrine.rst b/book/doctrine.rst index 63c15079822..ba6cf3617b1 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -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 .. code-block:: xml From cd009c7f47bf398b871baa1b9c1675865acf0692 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 2 Jul 2015 11:23:59 +0200 Subject: [PATCH 04/11] Fixed typo | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- book/doctrine.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/doctrine.rst b/book/doctrine.rst index 63c15079822..70376235304 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -1094,7 +1094,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`_. From 526ead00fd2cfaa63edc220cf6d1c3b62a073b61 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 2 Jul 2015 11:35:51 +0200 Subject: [PATCH 05/11] Another typo --- book/doctrine.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/doctrine.rst b/book/doctrine.rst index 70376235304..ab52e4a7017 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -1185,7 +1185,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 From eed20daf72cc5bb45f0dc2a405a2b285eb64d220 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 28 Jul 2015 19:07:01 +0200 Subject: [PATCH 06/11] Typo: Removed comma | Q | A | ------------- | --- | Doc fix? | [yes] | New docs? | [no] | Applies to | [2.3] | Fixed tickets |[] --- book/forms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/forms.rst b/book/forms.rst index 38186bba172..fde7babae4a 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -97,7 +97,7 @@ from inside a controller:: ->getForm(); return $this->render('default/new.html.twig', array( - 'form' => $form->createView(), + 'form' => $form->createView() )); } } From 52dcecd2394a7f5b95a65e69c9bef662314c4d73 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 28 Jul 2015 21:28:32 +0200 Subject: [PATCH 07/11] Update templating.rst --- book/templating.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/templating.rst b/book/templating.rst index 3eb6a1f777e..7d2148b9d6c 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -371,7 +371,7 @@ When working with template inheritance, here are some tips to keep in mind: {% endblock %} * Blocks can be nested. For better overview, you can add the block name to the - ``{% endblock %}`` tag like so: + ``{% endblock %}`` tag like this: .. code-block:: html+jinja From 8561baa7cf09d1ce64381c68265c5c9994968c98 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 28 Jul 2015 21:47:56 +0200 Subject: [PATCH 08/11] Added example for 'required' => false | Q | A | ------------- | --- | Doc fix? | [yes] | New docs? | [no] | Applies to | [2.3] | Fixed tickets | [] --- book/forms.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/book/forms.rst b/book/forms.rst index fde7babae4a..c4e95f5524c 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -669,9 +669,12 @@ the documentation for each type. The most common option is the ``required`` option, which can be applied to any field. By default, the ``required`` option is set to ``true``, meaning that HTML5-ready browsers will apply client-side validation if the field - is left blank. If you don't want this behavior, either set the ``required`` - option on your field to ``false`` or - :ref:`disable HTML5 validation `. + is left blank. If you don't want this behavior, either + :ref:`disable HTML5 validation ` + or set the ``required`` option on your field to ``false``: + + ->add('dueDate', 'date', array('widget' => 'single_text', + 'required' => false)) Also note that setting the ``required`` option to ``true`` will **not** result in server-side validation to be applied. In other words, if a From 01ab074c0e0fba3907a2e603efd5b0b054296c15 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 29 Jul 2015 12:50:53 +0200 Subject: [PATCH 09/11] Fixed typo | Q | A | ------------- | --- | Doc fix? | [yes] | New docs? | [no] | Applies to | [2.3] | Fixed tickets | [] --- book/forms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/forms.rst b/book/forms.rst index c4e95f5524c..772eddcb54a 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -913,7 +913,7 @@ specify it: Some field types have additional rendering options that can be passed to the widget. These options are documented with each type, but one common -options is ``attr``, which allows you to modify attributes on the form element. +option is ``attr``, which allows you to modify attributes on the form element. The following would add the ``task_field`` class to the rendered input text field: From f154514a5f5a2da8dedc534a69fed106be11963e Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 29 Jul 2015 23:29:46 +0200 Subject: [PATCH 10/11] Fixed file path "app/Resources/views/Form/fields.html.twig" didn't work for me - see next code block: "form_theme form 'AppBundle:Form:fields.html.twig'" If this change is correct, I guess it needs to be corrected multiple times on this page. --- cookbook/form/form_customization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/form/form_customization.rst b/cookbook/form/form_customization.rst index 6198e7b5726..4cab8696e24 100644 --- a/cookbook/form/form_customization.rst +++ b/cookbook/form/form_customization.rst @@ -282,7 +282,7 @@ can now re-use the form customization across many templates: .. code-block:: html+jinja - {# app/Resources/views/Form/fields.html.twig #} + {# src/AppBundle/Resources/views/Form/fields.html.twig #} {% block integer_widget %}
{% set type = type|default('number') %} From e5fbbf7fabef8e5a0fca31d98c7624a28558f035 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Fri, 31 Jul 2015 13:21:45 +0200 Subject: [PATCH 11/11] Minor clarification "the form" sounded like the HTML form. | Q | A | ------------- | --- | Doc fix? | [yes] | New docs? | [no] | Applies to | [2.3] | Fixed tickets | [] --- book/forms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/forms.rst b/book/forms.rst index 772eddcb54a..43af04260ae 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -212,7 +212,7 @@ Handling Form Submissions The second job of a form is to translate user-submitted data back to the properties of an object. To make this happen, the submitted data from the -user must be written into the form. Add the following functionality to your +user must be written into ``$form``. Add the following functionality to your controller:: // ...