mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-24 00:32:14 +01:00
Removing self-closing slash from <input>
This commit is contained in:
@@ -535,12 +535,12 @@ To work with multi-dimensional fields:
|
||||
.. code-block:: html
|
||||
|
||||
<form>
|
||||
<input name="multi[]"/>
|
||||
<input name="multi[]"/>
|
||||
<input name="multi[dimensional]"/>
|
||||
<input name="multi[dimensional][]" value="1"/>
|
||||
<input name="multi[dimensional][]" value="2"/>
|
||||
<input name="multi[dimensional][]" value="3"/>
|
||||
<input name="multi[]">
|
||||
<input name="multi[]">
|
||||
<input name="multi[dimensional]">
|
||||
<input name="multi[dimensional][]" value="1">
|
||||
<input name="multi[dimensional][]" value="2">
|
||||
<input name="multi[dimensional][]" value="3">
|
||||
</form>
|
||||
|
||||
Pass an array of values::
|
||||
|
||||
@@ -507,7 +507,7 @@ done by passing a special form "view" object to your template (notice the
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
|
||||
<input type="submit"/>
|
||||
<input type="submit">
|
||||
{{ form_end(form) }}
|
||||
|
||||
.. image:: /_images/form/simple-form.png
|
||||
|
||||
@@ -117,7 +117,7 @@ fields, so you no longer have to deal with form themes:
|
||||
value="{{ field_value(form.username) }}"
|
||||
placeholder="{{ field_label(form.username) }}"
|
||||
class="form-control"
|
||||
/>
|
||||
>
|
||||
|
||||
<select name="{{ field_name(form.country) }}" class="form-control">
|
||||
<option value="">{{ field_label(form.country) }}</option>
|
||||
|
||||
@@ -221,7 +221,7 @@ upon the form themes enabled in your app):
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<input type="number" id="form_age" name="form[age]" required="required" value="33"/>
|
||||
<input type="number" id="form_age" name="form[age]" required="required" value="33">
|
||||
|
||||
Symfony uses a Twig block called ``integer_widget`` to render that field. This
|
||||
is because the field type is ``integer`` and you're rendering its ``widget`` (as
|
||||
|
||||
@@ -245,7 +245,7 @@ You can find a list of existing mime types on the `IANA website`_.
|
||||
|
||||
When using this constraint on a :doc:`FileType field </reference/forms/types/file>`,
|
||||
the value of the ``mimeTypes`` option is also used in the ``accept``
|
||||
attribute of the related ``<input type="file"/>`` HTML element.
|
||||
attribute of the related ``<input type="file">`` HTML element.
|
||||
|
||||
This behavior is applied only when using :ref:`form type guessing <form-type-guessing>`
|
||||
(i.e. the form type is not defined explicitly in the ``->add()`` method of
|
||||
|
||||
@@ -2,7 +2,7 @@ EmailType Field
|
||||
===============
|
||||
|
||||
The ``EmailType`` field is a text field that is rendered using the HTML5
|
||||
``<input type="email"/>`` tag.
|
||||
``<input type="email">`` tag.
|
||||
|
||||
+---------------------------+---------------------------------------------------------------------+
|
||||
| Rendered as | ``input`` ``email`` field (a text box) |
|
||||
|
||||
@@ -2,7 +2,7 @@ RangeType Field
|
||||
===============
|
||||
|
||||
The ``RangeType`` field is a slider that is rendered using the HTML5
|
||||
``<input type="range"/>`` tag.
|
||||
``<input type="range">`` tag.
|
||||
|
||||
+---------------------------+---------------------------------------------------------------------+
|
||||
| Rendered as | ``input`` ``range`` field (slider in HTML5 supported browser) |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
SearchType Field
|
||||
================
|
||||
|
||||
This renders an ``<input type="search"/>`` field, which is a text box with
|
||||
This renders an ``<input type="search">`` field, which is a text box with
|
||||
special functionality supported by some browsers.
|
||||
|
||||
Read about the input search field at `DiveIntoHTML5.info`_
|
||||
|
||||
@@ -794,13 +794,13 @@ Finally, create or update the template:
|
||||
|
||||
<form action="{{ path('app_login') }}" method="post">
|
||||
<label for="username">Email:</label>
|
||||
<input type="text" id="username" name="_username" value="{{ last_username }}"/>
|
||||
<input type="text" id="username" name="_username" value="{{ last_username }}">
|
||||
|
||||
<label for="password">Password:</label>
|
||||
<input type="password" id="password" name="_password"/>
|
||||
<input type="password" id="password" name="_password">
|
||||
|
||||
{# If you want to control the URL the user is redirected to on success
|
||||
<input type="hidden" name="_target_path" value="/account"/> #}
|
||||
<input type="hidden" name="_target_path" value="/account"> #}
|
||||
|
||||
<button type="submit">login</button>
|
||||
</form>
|
||||
|
||||
@@ -141,7 +141,7 @@ generate a CSRF token in the template and store it as a hidden form field:
|
||||
|
||||
<form action="{{ url('admin_post_delete', { id: post.id }) }}" method="post">
|
||||
{# the argument of csrf_token() is an arbitrary string used to generate the token #}
|
||||
<input type="hidden" name="token" value="{{ csrf_token('delete-item') }}"/>
|
||||
<input type="hidden" name="token" value="{{ csrf_token('delete-item') }}">
|
||||
|
||||
<button type="submit">Delete item</button>
|
||||
</form>
|
||||
|
||||
@@ -157,8 +157,8 @@ Defining the redirect URL via POST using a hidden form field:
|
||||
<form action="{{ path('login') }}" method="post">
|
||||
{# ... #}
|
||||
|
||||
<input type="hidden" name="_target_path" value="{{ path('account') }}"/>
|
||||
<input type="submit" name="login"/>
|
||||
<input type="hidden" name="_target_path" value="{{ path('account') }}">
|
||||
<input type="submit" name="login">
|
||||
</form>
|
||||
|
||||
Using the Referring URL
|
||||
@@ -301,8 +301,8 @@ This option can also be set via the ``_failure_path`` request parameter:
|
||||
<form action="{{ path('login') }}" method="post">
|
||||
{# ... #}
|
||||
|
||||
<input type="hidden" name="_failure_path" value="{{ path('forgot_password') }}"/>
|
||||
<input type="submit" name="login"/>
|
||||
<input type="hidden" name="_failure_path" value="{{ path('forgot_password') }}">
|
||||
<input type="submit" name="login">
|
||||
</form>
|
||||
|
||||
Customizing the Target and Failure Request Parameters
|
||||
@@ -380,7 +380,7 @@ are now fully customized:
|
||||
<form action="{{ path('login') }}" method="post">
|
||||
{# ... #}
|
||||
|
||||
<input type="hidden" name="go_to" value="{{ path('dashboard') }}"/>
|
||||
<input type="hidden" name="back_to" value="{{ path('forgot_password') }}"/>
|
||||
<input type="submit" name="login"/>
|
||||
<input type="hidden" name="go_to" value="{{ path('dashboard') }}">
|
||||
<input type="hidden" name="back_to" value="{{ path('forgot_password') }}">
|
||||
<input type="submit" name="login">
|
||||
</form>
|
||||
|
||||
@@ -124,7 +124,7 @@ checkbox must have a name of ``_remember_me``:
|
||||
{# ... your form fields #}
|
||||
|
||||
<label>
|
||||
<input type="checkbox" name="_remember_me" checked/>
|
||||
<input type="checkbox" name="_remember_me" checked>
|
||||
Keep me logged in
|
||||
</label>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user