Skip to content

Commit 0c6eeac

Browse files
authored
Update form_helper.rst
1 parent 2c1ebbb commit 0c6eeac

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

user_guide_src/source/helpers/form_helper.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ The following functions are available:
9090
The above examples would create a form similar to this::
9191

9292
<form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" class="email" id="myform">
93+
94+
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:
95+
96+
form_open('/u/sign-up', ['csrf_id' => 'my-id']);
97+
98+
will return:
99+
100+
<form action="/u/sign-up" method="post" accept-charset="utf-8">
101+
<input type="hidden" id="my-id" name="csrf_field" value="964ede6e0ae8a680f7b8eab69136717d" />
93102

94103
**Adding Hidden Input Fields**
95104

0 commit comments

Comments
 (0)