summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-08 21:01:33 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-08 21:01:33 +0100
commitf7c39d6a123a73d90e4e9ebca2c66ed75731ab32 (patch)
tree0c5d666b33dd535cc13f4378825d2735e7ffa4f6 /user_guide_src/source/helpers
parent53b8ef524529e6ca9f32ad49d36c5140df84feb0 (diff)
Deprecate String helper trim_slashes()
trim(, '/') is even shorter ...
Diffstat (limited to 'user_guide_src/source/helpers')
-rw-r--r--user_guide_src/source/helpers/string_helper.rst28
1 files changed, 18 insertions, 10 deletions
diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst
index 530af2f89..86b1cdb34 100644
--- a/user_guide_src/source/helpers/string_helper.rst
+++ b/user_guide_src/source/helpers/string_helper.rst
@@ -10,9 +10,7 @@ strings.
Loading this Helper
===================
-This helper is loaded using the following code
-
-::
+This helper is loaded using the following code::
$this->load->helper('string');
@@ -88,11 +86,16 @@ your loop the next item will be returned.
repeater()
==========
-Generates repeating copies of the data you submit. Example
+.. php:function:: repeater($data, $num = 1)
-::
+ :param string $data: Input
+ :param int $num: Number of times to repeat
+ :returns: string
+
+Generates repeating copies of the data you submit. Example::
- $string = "\n"; echo repeater($string, 30);
+ $string = "\n";
+ echo repeater($string, 30);
The above would generate 30 newlines.
@@ -143,13 +146,19 @@ The above will return the following array:
trim_slashes()
==============
-Removes any leading/trailing slashes from a string. Example
+.. php:function:: trim_slashes($str)
-::
+ :param string $str: Input string
+ :returns: string
+
+Removes any leading/trailing slashes from a string. Example::
$string = "/this/that/theother/";
echo trim_slashes($string); // results in this/that/theother
+.. note:: This function is DEPRECATED. Use the native ``trim()`` instead:
+ |
+ | trim($str, '/');
reduce_multiples()
==================
@@ -195,5 +204,4 @@ strip_quotes()
Removes single and double quotes from a string. Example::
$string = "Joe's \"dinner\"";
- $string = strip_quotes($string); //results in "Joes dinner"
-
+ $string = strip_quotes($string); //results in "Joes dinner" \ No newline at end of file