summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source/helpers')
-rw-r--r--user_guide_src/source/helpers/directory_helper.rst27
-rw-r--r--user_guide_src/source/helpers/inflector_helper.rst6
-rw-r--r--user_guide_src/source/helpers/number_helper.rst2
-rw-r--r--user_guide_src/source/helpers/string_helper.rst2
-rw-r--r--user_guide_src/source/helpers/text_helper.rst5
-rw-r--r--user_guide_src/source/helpers/url_helper.rst21
6 files changed, 37 insertions, 26 deletions
diff --git a/user_guide_src/source/helpers/directory_helper.rst b/user_guide_src/source/helpers/directory_helper.rst
index 6c259adb1..fd169886c 100644
--- a/user_guide_src/source/helpers/directory_helper.rst
+++ b/user_guide_src/source/helpers/directory_helper.rst
@@ -18,15 +18,20 @@ This helper is loaded using the following code
The following functions are available:
-directory_map('source directory')
-=================================
+directory_map()
+===============
This function reads the directory path specified in the first parameter
and builds an array representation of it and all its contained files.
+
+.. php:method:: directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]])
-Example
-
-::
+ :param string $source_dir: path to the ource directory
+ :param integer $directory_depth: depth of directories to traverse (0 =
+ fully recursive, 1 = current dir, etc)
+ :param boolean $hidden: whether to include hidden directories
+
+Examples::
$map = directory_map('./mydirectory/');
@@ -35,23 +40,17 @@ Example
Sub-folders contained within the directory will be mapped as well. If
you wish to control the recursion depth, you can do so using the second
-parameter (integer). A depth of 1 will only map the top level directory
-
-::
+parameter (integer). A depth of 1 will only map the top level directory::
$map = directory_map('./mydirectory/', 1);
By default, hidden files will not be included in the returned array. To
-override this behavior, you may set a third parameter to true (boolean)
-
-::
+override this behavior, you may set a third parameter to true (boolean)::
$map = directory_map('./mydirectory/', FALSE, TRUE);
Each folder name will be an array index, while its contained files will
-be numerically indexed. Here is an example of a typical array
-
-::
+be numerically indexed. Here is an example of a typical array::
Array (    
[libraries] => Array    
diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst
index cf246b9de..cc46a1851 100644
--- a/user_guide_src/source/helpers/inflector_helper.rst
+++ b/user_guide_src/source/helpers/inflector_helper.rst
@@ -77,3 +77,9 @@ them. Each word is capitalized. Example
$word = "my_dog_spot";
echo humanize($word); // Returns "My Dog Spot"
+To use dashes instead of underscores
+
+::
+
+ $word = "my-dog-spot";
+ echo humanize($word, '-'); // Returns "My Dog Spot" \ No newline at end of file
diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst
index 28bc2f200..af6cdad57 100644
--- a/user_guide_src/source/helpers/number_helper.rst
+++ b/user_guide_src/source/helpers/number_helper.rst
@@ -42,4 +42,4 @@ result.
echo byte_format(45678, 2); // Returns 44.61 KB
.. note:: The text generated by this function is found in the following
- language file: language//number_lang.php
+ language file: language/<your_lang>/number_lang.php
diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst
index b8a69e036..dc70e461a 100644
--- a/user_guide_src/source/helpers/string_helper.rst
+++ b/user_guide_src/source/helpers/string_helper.rst
@@ -58,7 +58,7 @@ Usage example
echo increment_string('file', '_'); // "file_1"
echo increment_string('file', '-', 2); // "file-2"
- echo increment_string('file-4'); // "file-5"
+ echo increment_string('file_4'); // "file_5"
alternator()
============
diff --git a/user_guide_src/source/helpers/text_helper.rst b/user_guide_src/source/helpers/text_helper.rst
index e97643275..8cb2d6f96 100644
--- a/user_guide_src/source/helpers/text_helper.rst
+++ b/user_guide_src/source/helpers/text_helper.rst
@@ -46,6 +46,9 @@ more or less then what you specify. Example
The third parameter is an optional suffix added to the string, if
undeclared this helper uses an ellipsis.
+**Note:** If you need to truncate to an exact number of characters please see
+the :ref:`ellipsize` function below.
+
ascii_to_entities()
===================
@@ -136,6 +139,8 @@ complete words. Example
// Would produce: Here is a simple string of text that will help us demonstrate this function
+.. _ellipsize:
+
ellipsize()
===========
diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst
index c72558705..e6d51b22b 100644
--- a/user_guide_src/source/helpers/url_helper.rst
+++ b/user_guide_src/source/helpers/url_helper.rst
@@ -284,23 +284,24 @@ redirect()
==========
Does a "header redirect" to the URI specified. If you specify the full
-site URL that link will be build, but for local links simply providing
+site URL that link will be built, but for local links simply providing
the URI segments to the controller you want to direct to will create the
link. The function will build the URL based on your config file values.
-The optional second parameter allows you to choose between the
-"location" method (default) or the "refresh" method. Location is faster,
-but on Windows servers it can sometimes be a problem. The optional third
-parameter allows you to send a specific HTTP Response Code - this could
-be used for example to create 301 redirects for search engine purposes.
-The default Response Code is 302. The third parameter is *only*
-available with 'location' redirects, and not 'refresh'. Examples
+The optional second parameter allows you to force a particular redirection
+method. The available methods are "location" or "refresh", with location
+being faster but less reliable on Windows servers. The default is "auto",
+which will attempt to intelligently choose the method based on the server
+environment.
-::
+The optional third parameter allows you to send a specific HTTP Response
+Code - this could be used for example to create 301 redirects for search
+engine purposes. The default Response Code is 302. The third parameter is
+*only* available with 'location' redirects, and not 'refresh'. Examples::
if ($logged_in == FALSE)
{      
- redirect('/login/form/', 'refresh');
+ redirect('/login/form/');
}
// with 301 redirect