From 59f042652eb19db118ae5009c0e4a8dbf154b420 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 26 Feb 2014 19:04:36 +0200 Subject: Deprecate HTML helpers nbs(), br() --- user_guide_src/source/changelog.rst | 3 +- user_guide_src/source/helpers/html_helper.rst | 76 ++++++++++++---------- user_guide_src/source/installation/upgrade_300.rst | 12 ++++ 3 files changed, 55 insertions(+), 36 deletions(-) (limited to 'user_guide_src') 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 `` `` and ``
`` respectively. - :doc:`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 (
) based on the number you submit. - Example:: - - echo br(3); - - The above would produce: - - .. code-block:: html - -


- .. function:: heading([$data = ''[, $h = '1'[, $attributes = '']]]) :param string $data: Content @@ -151,23 +134,6 @@ The following functions are available: echo link_tag($link); // -.. 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 ( ) based on the number you submit. - Example:: - - echo nbs(3); - - The above would produce: - - .. code-block:: html - -     - .. function:: ul($list[, $attributes = '']) @@ -395,4 +361,44 @@ The following functions are available: XHTML+MathML+SVG (SVG host) xhtml-math-svg-sh XHTML+RDFa 1.0 xhtml-rdfa-1 XHTML+RDFa 1.1 xhtml-rdfa-2 - =============================== =================== ================================================================================================================================================== \ 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 (
) based on the number you submit. + Example:: + + echo br(3); + + The above would produce: + + .. code-block:: html + +


+ + .. note:: This function is DEPRECATED. Use the native ``str_repeat()`` + in combination with ``
`` 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 ( ) based on the number you submit. + Example:: + + echo nbs(3); + + The above would produce: + + .. code-block:: html + +     + + .. note:: This function is DEPRECATED. Use the native ``str_repeat()`` + in combination with `` `` 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 `` `` and ``
`` 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 ========================================= -- cgit v1.2.3-24-g4f1b