Skip to content

Commit b9bea2d

Browse files
committed
docs: add description how to get boolean attributes
1 parent f7a1610 commit b9bea2d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

user_guide_src/source/helpers/form_helper.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ The following functions are available:
175175

176176
.. literalinclude:: form_helper/014.php
177177

178+
If you want boolean attributes, pass the boolean value (``true``/``false``). In this case the boolean value does not matter:
179+
180+
.. literalinclude:: form_helper/035.php
181+
178182
If you would like your form to contain some additional data, like
179183
JavaScript, you can pass it as a string in the third parameter:
180184

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
$data = [
4+
'name' => 'username',
5+
'id' => 'username',
6+
'value' => '',
7+
'required' => true,
8+
];
9+
echo form_input($data);
10+
/*
11+
* Would produce:
12+
* <input type="text" name="username" value="" id="username" required />
13+
*/

0 commit comments

Comments
 (0)