Skip to content

Commit 2ef93a4

Browse files
committed
Merge pull request #1442 from Dinduks/add_doc_for_escape_label
[Form] Add doc for the escape_label option
2 parents f86dc39 + 4bf8cc8 commit 2ef93a4

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

reference/forms/types/field.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ The ``field`` type predefines a couple of options:
2222
.. include:: /reference/forms/types/options/attr.rst.inc
2323

2424
.. include:: /reference/forms/types/options/translation_domain.rst.inc
25+
26+
.. include:: /reference/forms/types/options/escape_label.rst.inc
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
escape_label
2+
~~~~~~~~~~~~
3+
**type**: ``Boolean`` **default**: ``true``
4+
5+
.. versionadded:: 2.1
6+
The ``escape_label`` option is new in Symfony 2.1.
7+
8+
If set to false, the label's content won't be escaped. This option is useful when wanting to use HTML tags inside a label.
9+
10+
.. code-block:: php
11+
12+
$builder->add('acceptRules', 'checkbox', array(
13+
'label' => '<strong>I accept the rules</strong>',
14+
'escape_label' => false,
15+
));
16+
17+

0 commit comments

Comments
 (0)