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

Fix CS for form templates locations #6773

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
14 changes: 7 additions & 7 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ your controller::
'form' => $form->createView(),
));
}

.. caution::

Be aware that the ``createView()`` method should be called *after* ``handleRequest``
Expand Down Expand Up @@ -686,7 +686,7 @@ the documentation for each type.
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
Expand Down Expand Up @@ -1711,7 +1711,7 @@ to define form output.
PHP
...

To automatically include the customized templates from the ``app/Resources/views/Form``
To automatically include the customized templates from the ``app/Resources/views/form``
directory created earlier in *all* templates, modify your application configuration
file:

Expand All @@ -1724,7 +1724,7 @@ file:
templating:
form:
resources:
- 'Form'
- ':form'
# ...

.. code-block:: xml
Expand All @@ -1740,7 +1740,7 @@ file:
<framework:config>
<framework:templating>
<framework:form>
<framework:resource>Form</framework:resource>
<framework:resource>:form</framework:resource>
</framework:form>
</framework:templating>
<!-- ... -->
Expand All @@ -1754,14 +1754,14 @@ file:
'templating' => array(
'form' => array(
'resources' => array(
'Form',
':form',
),
),
),
// ...
));

Any fragments inside the ``app/Resources/views/Form`` directory are now used
Any fragments inside the ``app/Resources/views/form`` directory are now used
globally to define form output.

.. index::
Expand Down
14 changes: 7 additions & 7 deletions cookbook/form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ the base block by using the ``parent()`` Twig function:

.. code-block:: html+twig

{# app/Resources/views/Form/fields.html.twig #}
{# app/Resources/views/form/fields.html.twig #}
{% extends 'form_div_layout.html.twig' %}

{% block integer_widget %}
Expand Down Expand Up @@ -558,7 +558,7 @@ PHP
~~~

By using the following configuration, any customized form fragments inside the
``app/Resources/views/Form`` folder will be used globally when a
``app/Resources/views/form`` folder will be used globally when a
form is rendered.

.. configuration-block::
Expand All @@ -570,7 +570,7 @@ form is rendered.
templating:
form:
resources:
- 'AppBundle:Form'
- ':form'
# ...

.. code-block:: xml
Expand All @@ -579,7 +579,7 @@ form is rendered.
<framework:config>
<framework:templating>
<framework:form>
<resource>AppBundle:Form</resource>
<resource>:form</resource>
</framework:form>
</framework:templating>
<!-- ... -->
Expand All @@ -593,7 +593,7 @@ form is rendered.
'templating' => array(
'form' => array(
'resources' => array(
'AppBundle:Form',
':form',
),
),
),
Expand Down Expand Up @@ -685,7 +685,7 @@ customize the ``name`` field only:

<?php echo $view['form']->widget($form['name']); ?>

<!-- app/Resources/views/Form/_product_name_widget.html.php -->
<!-- app/Resources/views/form/_product_name_widget.html.php -->
<div class="text_widget">
<?php echo $view['form']->block('form_widget_simple') ?>
</div>
Expand Down Expand Up @@ -742,7 +742,7 @@ You can also override the markup for an entire field row using the same method:

<?php echo $view['form']->row($form['name']); ?>

<!-- app/Resources/views/Form/_product_name_row.html.php -->
<!-- app/Resources/views/form/_product_name_row.html.php -->
<div class="name_row">
<?php echo $view['form']->label($form) ?>
<?php echo $view['form']->errors($form) ?>
Expand Down