summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-26 18:04:36 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-26 18:04:36 +0100
commit59f042652eb19db118ae5009c0e4a8dbf154b420 (patch)
treec83f1f75dc3753156f93fac1c9af7279faff4ae3
parent58e1c00275ecbe40c1fb27271650e75f80f0cf1d (diff)
Deprecate HTML helpers nbs(), br()
-rw-r--r--system/helpers/html_helper.php2
-rw-r--r--user_guide_src/source/changelog.rst3
-rw-r--r--user_guide_src/source/helpers/html_helper.rst76
-rw-r--r--user_guide_src/source/installation/upgrade_300.rst12
4 files changed, 57 insertions, 36 deletions
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index 8246cbd2b..e229d796e 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -371,6 +371,7 @@ if ( ! function_exists('br'))
/**
* Generates HTML BR tags based on number supplied
*
+ * @deprecated 3.0.0 Use str_repeat() instead
* @param int $count Number of times to repeat the tag
* @return string
*/
@@ -387,6 +388,7 @@ if ( ! function_exists('nbs'))
/**
* Generates non-breaking space entities based on number supplied
*
+ * @deprecated 3.0.0 Use str_repeat() instead
* @param int
* @return string
*/
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 6663a7d35..bef872f26 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -86,7 +86,8 @@ Release Date: Not Released
- Added more doctypes.
- Changed application and environment config files to be loaded in a cascade-like manner.
- - The doctypes array is now cached and loaded only once.
+ - Changed :func:`doctype()` to cache and only load once the doctypes array.
+ - Deprecated functions ``nbs()`` and ``br()``, which are just aliases for the native ``str_repeat()`` with ``&nbsp;`` and ``<br />`` respectively.
- :doc:`Inflector Helper <helpers/inflector_helper>` changes include:
diff --git a/user_guide_src/source/helpers/html_helper.rst b/user_guide_src/source/helpers/html_helper.rst
index 3324da8c0..ff387be10 100644
--- a/user_guide_src/source/helpers/html_helper.rst
+++ b/user_guide_src/source/helpers/html_helper.rst
@@ -25,23 +25,6 @@ Available Functions
The following functions are available:
-.. function:: br([$count = 1])
-
- :param int $count: Number of times to repeat the tag
- :returns: HTML line break tag
- :rtype: string
-
- Generates line break tags (<br />) based on the number you submit.
- Example::
-
- echo br(3);
-
- The above would produce:
-
- .. code-block:: html
-
- <br /><br /><br />
-
.. function:: heading([$data = ''[, $h = '1'[, $attributes = '']]])
:param string $data: Content
@@ -151,23 +134,6 @@ The following functions are available:
echo link_tag($link);
// <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />
-.. function:: nbs([$num = 1])
-
- :param int $num: Number of space entities to produce
- :returns: A sequence of non-breaking space HTML entities
- :rtype: string
-
- Generates non-breaking spaces (&nbsp;) based on the number you submit.
- Example::
-
- echo nbs(3);
-
- The above would produce:
-
- .. code-block:: html
-
- &nbsp;&nbsp;&nbsp;
-
.. function:: ul($list[, $attributes = ''])
@@ -395,4 +361,44 @@ The following functions are available:
XHTML+MathML+SVG (SVG host) xhtml-math-svg-sh <!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
XHTML+RDFa 1.0 xhtml-rdfa-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
XHTML+RDFa 1.1 xhtml-rdfa-2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
- =============================== =================== ================================================================================================================================================== \ No newline at end of file
+ =============================== =================== ==================================================================================================================================================
+
+.. function:: br([$count = 1])
+
+ :param int $count: Number of times to repeat the tag
+ :returns: HTML line break tag
+ :rtype: string
+
+ Generates line break tags (<br />) based on the number you submit.
+ Example::
+
+ echo br(3);
+
+ The above would produce:
+
+ .. code-block:: html
+
+ <br /><br /><br />
+
+ .. note:: This function is DEPRECATED. Use the native ``str_repeat()``
+ in combination with ``<br />`` instead.
+
+.. function:: nbs([$num = 1])
+
+ :param int $num: Number of space entities to produce
+ :returns: A sequence of non-breaking space HTML entities
+ :rtype: string
+
+ Generates non-breaking spaces (&nbsp;) based on the number you submit.
+ Example::
+
+ echo nbs(3);
+
+ The above would produce:
+
+ .. code-block:: html
+
+ &nbsp;&nbsp;&nbsp;
+
+ .. note:: This function is DEPRECATED. Use the native ``str_repeat()``
+ in combination with ``&nbsp;`` instead. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst
index 59df7c303..6915fafe2 100644
--- a/user_guide_src/source/installation/upgrade_300.rst
+++ b/user_guide_src/source/installation/upgrade_300.rst
@@ -450,6 +450,18 @@ its usage:
.. note:: This function is still available, but you're strongly encouraged to remove its usage sooner
rather than later as it is scheduled for removal in CodeIgniter 3.1+.
+HTML helpers nbs(), br()
+========================
+
+:doc:`HTML Helper <../helpers/html_helper>` functions ``nbs()`` and ``br()`` are just aliases
+for the native ``str_repeat()`` function used with ``&nbsp;`` and ``<br >`` respectively.
+
+Because there's no point in just aliasing native PHP functions, they are now deprecated and
+scheduled for removal in CodeIgniter 3.1+.
+
+.. note:: These functions are still available, but you're strongly encouraged to remove their usage
+ sooner rather than later.
+
Pagination library 'anchor_class' setting
=========================================