Skip to content

Commit 6540df0

Browse files
committed
docs: added note changed to be compatible html5 in html_helper and form_helper
1 parent bbf62aa commit 6540df0

File tree

26 files changed

+39
-29
lines changed

26 files changed

+39
-29
lines changed

user_guide_src/source/helpers/form_helper.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ forms.
99
:local:
1010
:depth: 2
1111

12+
Configuration
13+
=============
14+
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+
1217
Loading this Helper
1318
===================
1419

user_guide_src/source/helpers/form_helper/002.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
?>
66

7-
<input type="text" name="myfield" value="<?= $string ?>" />
7+
<input type="text" name="myfield" value="<?= $string ?>">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
form_hidden('username', 'johndoe');
4-
// Would produce: <input type="hidden" name="username" value="johndoe" />
4+
// Would produce: <input type="hidden" name="username" value="johndoe">

user_guide_src/source/helpers/form_helper/010.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
echo form_hidden($data);
1010
/*
1111
* Would produce:
12-
* <input type="hidden" name="name" value="John Doe" />
13-
* <input type="hidden" name="email" value="[email protected]" />
14-
* <input type="hidden" name="url" value="http://example.com" />
12+
* <input type="hidden" name="name" value="John Doe">
13+
* <input type="hidden" name="email" value="[email protected]">
14+
* <input type="hidden" name="url" value="http://example.com">
1515
*/

user_guide_src/source/helpers/form_helper/011.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
echo form_hidden('my_array', $data);
1010
/*
1111
* Would produce:
12-
* <input type="hidden" name="my_array[name]" value="John Doe" />
13-
* <input type="hidden" name="my_array[email]" value="[email protected]" />
14-
* <input type="hidden" name="my_array[url]" value="http://example.com" />
12+
* <input type="hidden" name="my_array[name]" value="John Doe">
13+
* <input type="hidden" name="my_array[email]" value="[email protected]">
14+
* <input type="hidden" name="my_array[url]" value="http://example.com">
1515
*/

user_guide_src/source/helpers/form_helper/012.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
echo form_input($data);
1212
/*
1313
* Would produce:
14-
* <input type="hidden" name="email" value="[email protected]" id="hiddenemail" class="hiddenemail" />
14+
* <input type="hidden" name="email" value="[email protected]" id="hiddenemail" class="hiddenemail">
1515
*/

user_guide_src/source/helpers/form_helper/013.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
echo form_input('username', 'johndoe');
44
/*
55
* Would produce:
6-
* <input type="text" name="username" value="johndoe" />
6+
* <input type="text" name="username" value="johndoe">
77
*/

user_guide_src/source/helpers/form_helper/014.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
echo form_input($data);
1212
/*
1313
* Would produce:
14-
* <input type="text" name="username" value="johndoe" id="username" maxlength="100" size="50" style="width:50%" />
14+
* <input type="text" name="username" value="johndoe" id="username" maxlength="100" size="50" style="width:50%">
1515
*/

user_guide_src/source/helpers/form_helper/015.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
echo form_input('username', 'johndoe', $js);
55
/*
66
* Would produce:
7-
* <input type="text" name="username" value="johndoe" onClick="some_function ()" />
7+
* <input type="text" name="username" value="johndoe" onClick="some_function ()">
88
*/

user_guide_src/source/helpers/form_helper/016.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
echo form_input('username', 'johndoe', $js);
55
/*
66
* Would produce:
7-
* <input type="text" name="username" value="johndoe" onClick="some_function ();" />
7+
* <input type="text" name="username" value="johndoe" onClick="some_function ();">
88
*/

user_guide_src/source/helpers/form_helper/017.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
echo form_input('email', '[email protected]', ['placeholder' => 'Email Address...'], 'email');
44
/*
55
* Would produce:
6-
* <input type="email" name="email" value="[email protected]" placeholder="Email Address..." />
6+
* <input type="email" name="email" value="[email protected]" placeholder="Email Address...">
77
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo form_checkbox('newsletter', 'accept', true);
4-
// Would produce: <input type="checkbox" name="newsletter" value="accept" checked="checked" />
4+
// Would produce: <input type="checkbox" name="newsletter" value="accept" checked="checked">

user_guide_src/source/helpers/form_helper/025.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
];
1010

1111
echo form_checkbox($data);
12-
// Would produce: <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
12+
// Would produce: <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo form_submit('mysubmit', 'Submit Post!');
4-
// Would produce: <input type="submit" name="mysubmit" value="Submit Post!" />
4+
// Would produce: <input type="submit" name="mysubmit" value="Submit Post!">

user_guide_src/source/helpers/form_helper/035.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
echo form_input($data);
1010
/*
1111
* Would produce:
12-
* <input type="text" name="username" value="" id="username" required />
12+
* <input type="text" name="username" value="" id="username" required>
1313
*/

user_guide_src/source/helpers/html_helper.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ HTML.
99
:local:
1010
:depth: 2
1111

12+
Configuration
13+
=============
14+
15+
Since ``v4.3.0``, void HTML elements (e.g. ``<img>``) in ``html_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+
1217
Loading this Helper
1318
===================
1419

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo img('images/picture.jpg');
4-
// <img src="http://site.com/images/picture.jpg" />
4+
// <img src="http://site.com/images/picture.jpg">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo img('images/picture.jpg', true);
4-
// <img src="http://site.com/index.php/images/picture.jpg" alt="" />
4+
// <img src="http://site.com/index.php/images/picture.jpg" alt="">

user_guide_src/source/helpers/html_helper/004.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
];
1212

1313
img($imageProperties);
14-
// <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />
14+
// <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo link_tag('css/mystyles.css');
4-
// <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />
4+
// <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css">
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
4-
// <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" />
4+
// <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico">
55

66
echo link_tag('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
7-
// <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
7+
// <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed">

user_guide_src/source/helpers/html_helper/009.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
];
99

1010
echo link_tag($link);
11-
// <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />
11+
// <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo source('movie.mp4', 'video/mp4', 'class="test"');
4-
// <source src="movie.mp4" type="video/mp4" class="test" />
4+
// <source src="movie.mp4" type="video/mp4" class="test">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo embed('movie.mov', 'video/quicktime', 'class="test"');
4-
// <embed src="movie.mov" type="video/quicktime" class="test"/>
4+
// <embed src="movie.mov" type="video/quicktime" class="test">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo param('movie.mov', 'video/quicktime', 'class="test"');
4-
// <param src="movie.mov" type="video/quicktime" class="test"/>
4+
// <param src="movie.mov" type="video/quicktime" class="test">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
echo track('subtitles_no.vtt', 'subtitles', 'no', 'Norwegian No');
4-
// <track src="subtitles_no.vtt" kind="subtitles" srclang="no" label="Norwegian No" />
4+
// <track src="subtitles_no.vtt" kind="subtitles" srclang="no" label="Norwegian No">

0 commit comments

Comments
 (0)