@@ -230,6 +230,10 @@ object:
230
230
<?php echo $view['form']->get('name')->vars['label'] ?>
231
231
</label>
232
232
233
+ .. versionadded :: 2.1
234
+ The ``valid ``, ``label_attr ``, ``compound ``, and ``disabled `` variables
235
+ are new in Symfony 2.1.
236
+
233
237
+-----------------+-----------------------------------------------------------------------------------------+
234
238
| Variable | Usage |
235
239
+=================+=========================================================================================+
@@ -243,10 +247,15 @@ object:
243
247
| ``errors `` | An array of any errors attached to *this * specific field (e.g. ``form.title.errors ``). |
244
248
| | Note that you can't use ``form.errors `` to determine if a form is valid, |
245
249
| | since this only returns "global" errors: some individual fields may have errors |
250
+ | | Instead, use the ``valid `` option |
251
+ +-----------------+-----------------------------------------------------------------------------------------+
252
+ | ``valid `` | Returns ``true `` or ``false `` depending on whether the whole form is valid |
246
253
+-----------------+-----------------------------------------------------------------------------------------+
247
254
| ``value `` | The value that will be used when rendering (commonly the ``value `` HTML attribute) |
248
255
+-----------------+-----------------------------------------------------------------------------------------+
249
- | ``read_only `` | If ``true ``, ``disabled="disabled" `` is added to the field |
256
+ | ``read_only `` | If ``true ``, ``readonly="readonly" `` is added to the field |
257
+ +-----------------+-----------------------------------------------------------------------------------------+
258
+ | ``disabled `` | If ``true ``, ``disabled="disabled" `` is added to the field |
250
259
+-----------------+-----------------------------------------------------------------------------------------+
251
260
| ``required `` | If ``true ``, a ``required `` attribute is added to the field to activate HTML5 |
252
261
| | validation. Additionally, a ``required `` class is added to the label. |
@@ -262,5 +271,10 @@ object:
262
271
+-----------------+-----------------------------------------------------------------------------------------+
263
272
| ``attr `` | A key-value array that will be rendered as HTML attributes on the field |
264
273
+-----------------+-----------------------------------------------------------------------------------------+
274
+ | ``label_attr `` | A key-value array that will be rendered as HTML attributes on the label |
275
+ +-----------------+-----------------------------------------------------------------------------------------+
276
+ | ``compound `` | Whether or not a field is actually a holder for a group of children fields |
277
+ | | (for example, a ``choice `` field, which is actually a group of checkboxes |
278
+ +-----------------+-----------------------------------------------------------------------------------------+
265
279
266
280
.. _`form_div_layout.html.twig` : https://github.com/symfony/symfony/blob/2.1/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
0 commit comments