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: user_guide_src/source/helpers/form_helper.rst
+21-17Lines changed: 21 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,25 +9,28 @@ forms.
9
9
:local:
10
10
:depth: 2
11
11
12
+
*************
12
13
Configuration
13
-
=============
14
+
*************
14
15
15
-
Since ``v4.3.0``, void HTML elements (e.g. ``<input>``) in ``form_helper`` functions have been changed to be HTML5-compatible by default and if you need to be compatible with XHTML, you must set the ``$html5`` property in **app/Config/DocTypes.php** to ``false``.
16
+
Since v4.3.0, void HTML elements (e.g. ``<input>``) in ``form_helper`` functions have been changed to be HTML5-compatible by default and if you need to be compatible with XHTML, you must set the ``$html5`` property in **app/Config/DocTypes.php** to ``false``.
16
17
18
+
*******************
17
19
Loading this Helper
18
-
===================
20
+
*******************
19
21
20
22
This helper is loaded using the following code:
21
23
22
24
.. literalinclude:: form_helper/001.php
23
25
24
-
Escaping field values
25
-
=====================
26
+
*********************
27
+
Escaping Field Values
28
+
*********************
26
29
27
30
You may need to use HTML and characters such as quotes within your form
28
31
elements. In order to do that safely, you'll need to use
29
32
:doc:`common function <../general/common_functions>`
30
-
:func:`esc()`.
33
+
:php:func:`esc()`.
31
34
32
35
Consider the following example:
33
36
@@ -37,16 +40,17 @@ Since the above string contains a set of quotes, it will cause the form
37
40
to break. The :php:func:`esc()` function converts HTML special
If CSRF filter is turned on ``form_open()`` will generate CSRF field at the beginning of the form. You can specify ID of this field by passing csrf_id as one of the ``$attribute`` array:
106
+
If :ref:`CSRF<cross-site-request-forgery>` filter is turned on ``form_open()`` will generate CSRF field at the beginning of the form. You can specify ID of this field by passing csrf_id as one of the ``$attribute`` array:
.. note:: To use auto-generation of CSRF field, you need to turn CSRF filter on to the form page. In most cases it is requested using the ``GET`` method.
112
116
@@ -122,8 +126,8 @@ The following functions are available:
122
126
The above example would create a form similar to this::
0 commit comments