From 12b77afd3b68795bdac35d8942911c4e32836702 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 11 Mar 2015 15:54:43 +0100 Subject: [PATCH 1/5] Better explain that form types should be unique in the application --- book/forms.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/book/forms.rst b/book/forms.rst index bcc5282d2d8..b8b42564068 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -1057,9 +1057,15 @@ that will house the logic for building the task form:: } } -This new class contains all the directions needed to create the task form -(note that the ``getName()`` method should return a unique identifier for this -form "type"). It can be used to quickly build a form object in the controller:: +.. caution:: + + The ``getName()`` method returns the identifier of this form "type". These + identifiers must be unique in the application and, unless you want to override + a built-in type, they should be different from the default Symfony types. + Consider prefixing your types with ``app_`` to avoid identifier collisions. + +This new class contains all the directions needed to create the task form. It can +be used to quickly build a form object in the controller: // src/AppBundle/Controller/DefaultController.php From d47e751f551b5a405498d6ff721f139286a9c0f0 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 12 Mar 2015 09:03:57 +0100 Subject: [PATCH 2/5] Fixed syntax issues and provided more information --- book/forms.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/book/forms.rst b/book/forms.rst index b8b42564068..56f80c9fc27 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -1060,12 +1060,13 @@ that will house the logic for building the task form:: .. caution:: The ``getName()`` method returns the identifier of this form "type". These - identifiers must be unique in the application and, unless you want to override - a built-in type, they should be different from the default Symfony types. + identifiers must be unique in the application. Unless you want to override + a built-in type, they should be different from the default Symfony types + and from any type defined by a third-party bundle installed in you application. Consider prefixing your types with ``app_`` to avoid identifier collisions. This new class contains all the directions needed to create the task form. It can -be used to quickly build a form object in the controller: +be used to quickly build a form object in the controller:: // src/AppBundle/Controller/DefaultController.php From 52a55511926a860579e34b65239c89a6f92954b3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 19 Mar 2015 09:47:38 +0100 Subject: [PATCH 3/5] Recommend a better way to standardize application form types --- book/forms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/forms.rst b/book/forms.rst index 56f80c9fc27..cd538f7d11c 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -1063,7 +1063,7 @@ that will house the logic for building the task form:: identifiers must be unique in the application. Unless you want to override a built-in type, they should be different from the default Symfony types and from any type defined by a third-party bundle installed in you application. - Consider prefixing your types with ``app_`` to avoid identifier collisions. + Consider prefixing your types with ``app.`` to avoid identifier collisions. This new class contains all the directions needed to create the task form. It can be used to quickly build a form object in the controller:: From 0eb149bbb53438a53bb120224270eed579612c85 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 19 Mar 2015 16:59:51 +0100 Subject: [PATCH 4/5] Recommend app_ instead of app. as form type prefix --- book/forms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/forms.rst b/book/forms.rst index cd538f7d11c..56f80c9fc27 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -1063,7 +1063,7 @@ that will house the logic for building the task form:: identifiers must be unique in the application. Unless you want to override a built-in type, they should be different from the default Symfony types and from any type defined by a third-party bundle installed in you application. - Consider prefixing your types with ``app.`` to avoid identifier collisions. + Consider prefixing your types with ``app_`` to avoid identifier collisions. This new class contains all the directions needed to create the task form. It can be used to quickly build a form object in the controller:: From 7a7853260fee17e66c2916d64f17a51aa045151e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 19 Mar 2015 22:13:11 +0100 Subject: [PATCH 5/5] Fixed a minor grammar issue --- book/forms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/forms.rst b/book/forms.rst index 56f80c9fc27..e1e0c69de1d 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -1062,7 +1062,7 @@ that will house the logic for building the task form:: The ``getName()`` method returns the identifier of this form "type". These identifiers must be unique in the application. Unless you want to override a built-in type, they should be different from the default Symfony types - and from any type defined by a third-party bundle installed in you application. + and from any type defined by a third-party bundle installed in your application. Consider prefixing your types with ``app_`` to avoid identifier collisions. This new class contains all the directions needed to create the task form. It can