You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: markup/functions/form.md
+28
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,34 @@ The above example would output as the following:
110
110
</form>
111
111
```
112
112
113
+
## form_token()
114
+
115
+
Outputs a `_token` hidden fields for CSRF protection.
116
+
117
+
```twig
118
+
{{ form_token() }}
119
+
```
120
+
121
+
The above example would output as the following:
122
+
123
+
```html
124
+
<inputname="_token"type="hidden"value="...">
125
+
```
126
+
127
+
## form_submit()
128
+
129
+
Outputs an `input` element of type `submit`. This tag is generally available to provide consistency in usage.
130
+
131
+
```twig
132
+
{{ form_submit() }}
133
+
```
134
+
135
+
The above example would output as the following:
136
+
137
+
```html
138
+
<inputtype="submit">
139
+
```
140
+
113
141
## Passing attributes to the generated element
114
142
115
143
You can pass additional attributes to the `Form::open()` method by passing an array of attribute names and values to be rendered on the final generated `<form>` element.
0 commit comments