-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
2.3 #5569
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
Changes from all commits
8700975
87e2c1e
6ae94e9
cd009c7
526ead0
0875f78
cbc3e26
8e5813c
826a463
eed20da
d893965
52dcecd
8561baa
01ab074
f154514
f57c14c
e5fbbf7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,7 @@ from inside a controller:: | |
->getForm(); | ||
|
||
return $this->render('default/new.html.twig', array( | ||
'form' => $form->createView(), | ||
'form' => $form->createView() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be reverted to comply with the Symfony CS. |
||
)); | ||
} | ||
} | ||
|
@@ -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:: | ||
|
||
// ... | ||
|
@@ -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 <book-forms-html5-validation-disable>`. | ||
is left blank. If you don't want this behavior, either | ||
:ref:`disable HTML5 validation <book-forms-html5-validation-disable>` | ||
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 | ||
|
@@ -910,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: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 #} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks wrong to me. Best practices are to put templates in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anyhow. My point is that the path used in the code exampled throughout this page is inconsistent! I don't know what the best practice is. If you don't want to change it here, then please change it in the next codeblock (and probably some others). |
||
{% block integer_widget %} | ||
<div class="integer_widget"> | ||
{% set type = type|default('number') %} | ||
|
There was a problem hiding this comment.
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).There was a problem hiding this comment.
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