diff options
author | Andrew <browner12@gmail.com> | 2014-02-11 09:55:48 +0100 |
---|---|---|
committer | Andrew <browner12@gmail.com> | 2014-02-11 09:55:48 +0100 |
commit | b6d8b962e44202a74c9b9321a4a53f61a753fccf (patch) | |
tree | 2d3c533a55964a0d124f7cd6bb1d3d98c7b84056 /user_guide_src/source/helpers/directory_helper.rst | |
parent | 41713aaa665189dd0a191c333c73c4a7b9f37c78 (diff) | |
parent | 29e12641a1bb952f493462db6757ae12c7da1f2c (diff) |
Merge branch 'develop' into patch-1
Conflicts:
system/libraries/Calendar.php
Diffstat (limited to 'user_guide_src/source/helpers/directory_helper.rst')
-rw-r--r-- | user_guide_src/source/helpers/directory_helper.rst | 124 |
1 files changed, 64 insertions, 60 deletions
diff --git a/user_guide_src/source/helpers/directory_helper.rst b/user_guide_src/source/helpers/directory_helper.rst index a785ebc8c..3004316a8 100644 --- a/user_guide_src/source/helpers/directory_helper.rst +++ b/user_guide_src/source/helpers/directory_helper.rst @@ -5,7 +5,12 @@ Directory Helper The Directory Helper file contains functions that assist in working with directories. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + + <div class="custom-index container"></div> Loading this Helper =================== @@ -16,64 +21,63 @@ This helper is loaded using the following code $this->load->helper('directory'); +Available Functions +=================== + The following functions are available: -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]]) - - :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/'); - -.. note:: Paths are almost always relative to your main index.php file. - - -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:: - - $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):: - - $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:: - - Array ( - [libraries] => Array - ( - [0] => benchmark.html - [1] => config.html - ["database/"] => Array - ( - [0] => query_builder.html - [1] => binds.html - [2] => configuration.html - [3] => connecting.html - [4] => examples.html - [5] => fields.html - [6] => index.html - [7] => queries.html - ) - [2] => email.html - [3] => file_uploading.html - [4] => image_lib.html - [5] => input.html - [6] => language.html - [7] => loader.html - [8] => pagination.html - [9] => uri.html - )
\ No newline at end of file + +.. function:: directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]]) + + :param string $source_dir: Path to the ource directory + :param int $directory_depth: Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc) + :param bool $hidden: Whether to include hidden directories + :returns: An array of files + :rtype: array + + Examples:: + + $map = directory_map('./mydirectory/'); + + .. note:: Paths are almost always relative to your main index.php file. + + + 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:: + + $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):: + + $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:: + + Array ( + [libraries] => Array + ( + [0] => benchmark.html + [1] => config.html + ["database/"] => Array + ( + [0] => query_builder.html + [1] => binds.html + [2] => configuration.html + [3] => connecting.html + [4] => examples.html + [5] => fields.html + [6] => index.html + [7] => queries.html + ) + [2] => email.html + [3] => file_uploading.html + [4] => image_lib.html + [5] => input.html + [6] => language.html + [7] => loader.html + [8] => pagination.html + [9] => uri.html + )
\ No newline at end of file |