From 8ede1a2ecbb62577afd32996956c5feaf7ddf9b6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 5 Oct 2011 13:34:52 -0500 Subject: replacing the old HTML user guide with a Sphinx-managed user guide --- user_guide_src/source/helpers/directory_helper.rst | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 user_guide_src/source/helpers/directory_helper.rst (limited to 'user_guide_src/source/helpers/directory_helper.rst') diff --git a/user_guide_src/source/helpers/directory_helper.rst b/user_guide_src/source/helpers/directory_helper.rst new file mode 100644 index 000000000..6c259adb1 --- /dev/null +++ b/user_guide_src/source/helpers/directory_helper.rst @@ -0,0 +1,81 @@ +################ +Directory Helper +################ + +The Directory Helper file contains functions that assist in working with +directories. + +.. contents:: Page Contents + +Loading this Helper +=================== + +This helper is loaded using the following code + +:: + + $this->load->helper('directory'); + +The following functions are available: + +directory_map('source directory') +================================= + +This function reads the directory path specified in the first parameter +and builds an array representation of it and all its contained files. + +Example + +:: + + $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] => active_record.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 + ) + -- cgit v1.2.3-24-g4f1b