diff options
author | Brennan Thompson <brenjt@gmail.com> | 2014-02-14 20:03:57 +0100 |
---|---|---|
committer | Brennan Thompson <brenjt@gmail.com> | 2014-02-14 20:03:57 +0100 |
commit | 6949f95f6e21980f36095490bf38fc8a172dbc0f (patch) | |
tree | b3141f390acd0051396cda6a3da51c1f98384cca /user_guide_src/source/libraries/config.rst | |
parent | 68a02a01a086bbb1b8128ea2744439de84873d11 (diff) | |
parent | 81f036753272391360ba5b64e6dd93c4101a8733 (diff) |
Merge remote-tracking branch 'upstream/develop' into develop
Conflicts:
system/helpers/form_helper.php
Diffstat (limited to 'user_guide_src/source/libraries/config.rst')
-rw-r--r-- | user_guide_src/source/libraries/config.rst | 103 |
1 files changed, 86 insertions, 17 deletions
diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst index 654dc4ded..3116b768a 100644 --- a/user_guide_src/source/libraries/config.rst +++ b/user_guide_src/source/libraries/config.rst @@ -9,7 +9,16 @@ These preferences can come from the default config file .. note:: This class is initialized automatically by the system so there is no need to do it manually. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + + <div class="custom-index container"></div> + +***************************** +Working with the Config Class +***************************** Anatomy of a Config File ======================== @@ -157,27 +166,87 @@ folders: that you wish to change for your environment. The config items declared in your environment folders always overwrite those in your global config files. -Helper Functions -================ -The config class has the following helper functions: +*************** +Class Reference +*************** -$this->config->site_url(); -*************************** +.. class:: CI_Config -This function retrieves the URL to your site, along with the "index" -value you've specified in the config file. + .. attribute:: $config -$this->config->base_url(); -*************************** + Array of all loaded config values -This function retrieves the URL to your site, plus an optional path such -as to a stylesheet or image. + .. attribute:: $is_loaded -The two functions above are normally accessed via the corresponding -functions in the :doc:`URL Helper </helpers/url_helper>`. + Array of all loaded config files -$this->config->system_url(); -***************************** -This function retrieves the URL to your system folder. + .. method:: item($item[, $index='']) + + :param string $item: Config item name + :param string $index: Index name + :returns: Config item value or NULL if not found + :rtype: mixed + + Fetch a config file item. + + .. method:: set_item($item, $value) + + :param string $item: Config item name + :param string $value: Config item value + :rtype: void + + Sets a config file item to the specified value. + + .. method:: slash_item($item) + + :param string $item: config item name + :returns: Config item value with a trailing forward slash or NULL if not found + :rtype: mixed + + This method is identical to ``item()``, except it appends a forward + slash to the end of the item, if it exists. + + .. method:: load([$file = ''[, $use_sections = FALSE[, $fail_gracefully = FALSE]]]) + + :param string $file: Configuration file name + :param bool $use_sections: Whether config values shoud be loaded into their own section (index of the main config array) + :param bool $fail_gracefully: Whether to return FALSE or to display an error message + :returns: TRUE on success, FALSE on failure + :rtype: bool + + Loads a configuration file. + + .. method:: site_url() + + :returns: Site URL + :rtype: string + + This method retrieves the URL to your site, along with the "index" value + you've specified in the config file. + + This method is normally accessed via the corresponding functions in the + :doc:`URL Helper </helpers/url_helper>`. + + .. method:: base_url() + + :returns: Base URL + :rtype: string + + This method retrieves the URL to your site, plus an optional path such + as to a stylesheet or image. + + This method is normally accessed via the corresponding functions in the + :doc:`URL Helper </helpers/url_helper>`. + + .. method:: system_url() + + :returns: URL pointing at your CI system/ directory + :rtype: string + + This method retrieves the URL to your CodeIgniter system/ directory. + + .. note:: This method is DEPRECATED because it encourages usage of + insecure coding practices. Your *system/* directory shouldn't + be publicly accessible.
\ No newline at end of file |