Expand file tree Collapse file tree 12 files changed +25
-25
lines changed Original file line number Diff line number Diff line change @@ -535,12 +535,12 @@ To work with multi-dimensional fields:
535
535
.. code-block :: html
536
536
537
537
<form >
538
- <input name =" multi[]" / >
539
- <input name =" multi[]" / >
540
- <input name =" multi[dimensional]" / >
541
- <input name =" multi[dimensional][]" value =" 1" / >
542
- <input name =" multi[dimensional][]" value =" 2" / >
543
- <input name =" multi[dimensional][]" value =" 3" / >
538
+ <input name =" multi[]" >
539
+ <input name =" multi[]" >
540
+ <input name =" multi[dimensional]" >
541
+ <input name =" multi[dimensional][]" value =" 1" >
542
+ <input name =" multi[dimensional][]" value =" 2" >
543
+ <input name =" multi[dimensional][]" value =" 3" >
544
544
</form >
545
545
546
546
Pass an array of values::
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ done by passing a special form "view" object to your template (notice the
507
507
{{ form_start(form) }}
508
508
{{ form_widget(form) }}
509
509
510
- <input type="submit"/ >
510
+ <input type="submit">
511
511
{{ form_end(form) }}
512
512
513
513
.. image :: /_images/form/simple-form.png
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ fields, so you no longer have to deal with form themes:
117
117
value="{{ field_value(form.username) }}"
118
118
placeholder="{{ field_label(form.username) }}"
119
119
class="form-control"
120
- / >
120
+ >
121
121
122
122
<select name="{{ field_name(form.country) }}" class="form-control">
123
123
<option value="">{{ field_label(form.country) }}</option>
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ upon the form themes enabled in your app):
221
221
222
222
.. code-block :: html
223
223
224
- <input type =" number" id =" form_age" name =" form[age]" required =" required" value =" 33" / >
224
+ <input type =" number" id =" form_age" name =" form[age]" required =" required" value =" 33" >
225
225
226
226
Symfony uses a Twig block called ``integer_widget `` to render that field. This
227
227
is because the field type is ``integer `` and you're rendering its ``widget `` (as
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ You can find a list of existing mime types on the `IANA website`_.
245
245
246
246
When using this constraint on a :doc: `FileType field </reference/forms/types/file >`,
247
247
the value of the ``mimeTypes `` option is also used in the ``accept ``
248
- attribute of the related ``<input type="file"/ > `` HTML element.
248
+ attribute of the related ``<input type="file"> `` HTML element.
249
249
250
250
This behavior is applied only when using :ref: `form type guessing <form-type-guessing >`
251
251
(i.e. the form type is not defined explicitly in the ``->add() `` method of
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ EmailType Field
2
2
===============
3
3
4
4
The ``EmailType `` field is a text field that is rendered using the HTML5
5
- ``<input type="email"/ > `` tag.
5
+ ``<input type="email"> `` tag.
6
6
7
7
+---------------------------+---------------------------------------------------------------------+
8
8
| Rendered as | ``input `` ``email `` field (a text box) |
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ RangeType Field
2
2
===============
3
3
4
4
The ``RangeType `` field is a slider that is rendered using the HTML5
5
- ``<input type="range"/ > `` tag.
5
+ ``<input type="range"> `` tag.
6
6
7
7
+---------------------------+---------------------------------------------------------------------+
8
8
| Rendered as | ``input `` ``range `` field (slider in HTML5 supported browser) |
Original file line number Diff line number Diff line change 1
1
SearchType Field
2
2
================
3
3
4
- This renders an ``<input type="search"/ > `` field, which is a text box with
4
+ This renders an ``<input type="search"> `` field, which is a text box with
5
5
special functionality supported by some browsers.
6
6
7
7
Read about the input search field at `DiveIntoHTML5.info `_
Original file line number Diff line number Diff line change @@ -794,13 +794,13 @@ Finally, create or update the template:
794
794
795
795
<form action="{{ path('app_login') }}" method="post">
796
796
<label for="username">Email:</label>
797
- <input type="text" id="username" name="_username" value="{{ last_username }}"/ >
797
+ <input type="text" id="username" name="_username" value="{{ last_username }}">
798
798
799
799
<label for="password">Password:</label>
800
- <input type="password" id="password" name="_password"/ >
800
+ <input type="password" id="password" name="_password">
801
801
802
802
{# If you want to control the URL the user is redirected to on success
803
- <input type="hidden" name="_target_path" value="/account"/ > #}
803
+ <input type="hidden" name="_target_path" value="/account"> #}
804
804
805
805
<button type="submit">login</button>
806
806
</form>
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ generate a CSRF token in the template and store it as a hidden form field:
141
141
142
142
<form action="{{ url('admin_post_delete', { id: post.id }) }}" method="post">
143
143
{# the argument of csrf_token() is an arbitrary string used to generate the token #}
144
- <input type="hidden" name="token" value="{{ csrf_token('delete-item') }}"/ >
144
+ <input type="hidden" name="token" value="{{ csrf_token('delete-item') }}">
145
145
146
146
<button type="submit">Delete item</button>
147
147
</form>
Original file line number Diff line number Diff line change @@ -157,8 +157,8 @@ Defining the redirect URL via POST using a hidden form field:
157
157
<form action="{{ path('login') }}" method="post">
158
158
{# ... #}
159
159
160
- <input type="hidden" name="_target_path" value="{{ path('account') }}"/ >
161
- <input type="submit" name="login"/ >
160
+ <input type="hidden" name="_target_path" value="{{ path('account') }}">
161
+ <input type="submit" name="login">
162
162
</form>
163
163
164
164
Using the Referring URL
@@ -301,8 +301,8 @@ This option can also be set via the ``_failure_path`` request parameter:
301
301
<form action="{{ path('login') }}" method="post">
302
302
{# ... #}
303
303
304
- <input type="hidden" name="_failure_path" value="{{ path('forgot_password') }}"/ >
305
- <input type="submit" name="login"/ >
304
+ <input type="hidden" name="_failure_path" value="{{ path('forgot_password') }}">
305
+ <input type="submit" name="login">
306
306
</form>
307
307
308
308
Customizing the Target and Failure Request Parameters
@@ -380,7 +380,7 @@ are now fully customized:
380
380
<form action="{{ path('login') }}" method="post">
381
381
{# ... #}
382
382
383
- <input type="hidden" name="go_to" value="{{ path('dashboard') }}"/ >
384
- <input type="hidden" name="back_to" value="{{ path('forgot_password') }}"/ >
385
- <input type="submit" name="login"/ >
383
+ <input type="hidden" name="go_to" value="{{ path('dashboard') }}">
384
+ <input type="hidden" name="back_to" value="{{ path('forgot_password') }}">
385
+ <input type="submit" name="login">
386
386
</form>
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ checkbox must have a name of ``_remember_me``:
124
124
{# ... your form fields #}
125
125
126
126
<label>
127
- <input type="checkbox" name="_remember_me" checked/ >
127
+ <input type="checkbox" name="_remember_me" checked>
128
128
Keep me logged in
129
129
</label>
130
130
<
30A6
svg aria-hidden="true" version="1.1" viewBox="0 0 340 84" xmlns="http://www.w3.org/2000/svg" class="Box-sc-g0xbh4-0 hqtbbn">
0 commit comments