diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-20 14:03:43 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-20 14:03:43 +0100 |
commit | ea801ab4ab80042638ffddc6056483a1ec43fa80 (patch) | |
tree | f75f30c0df6a8f861ca7df22af09fa3240b0bbd6 /user_guide_src/source/libraries/loader.rst | |
parent | 1c08d557a21ecb0f79cd1a1de4e06817a26e0537 (diff) | |
parent | 4d0571666d03511ac5b4a1f2a6882ccb1509a209 (diff) |
Merge branch 'develop' into feature/user-guide-cleanup
Diffstat (limited to 'user_guide_src/source/libraries/loader.rst')
-rw-r--r-- | user_guide_src/source/libraries/loader.rst | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/user_guide_src/source/libraries/loader.rst b/user_guide_src/source/libraries/loader.rst index ec5a87bb4..15d9d80fc 100644 --- a/user_guide_src/source/libraries/loader.rst +++ b/user_guide_src/source/libraries/loader.rst @@ -278,6 +278,12 @@ Class Reference This method retrieves all variables available to your views. + .. method:: clear_vars() + + :returns: object + + Clears cached view variables. + .. method:: model($model[, $name = ''[, $db_conn = FALSE]]) :param mixed $model: Model name or an array containing multiple models @@ -292,7 +298,7 @@ Class Reference If your model is located in a subdirectory, include the relative path from your models directory. For example, if you have a model located at - *application/models/blog/queries.php* you'll load it using:: + *application/models/blog/Queries.php* you'll load it using:: $this->load->model('blog/queries'); @@ -370,6 +376,33 @@ Class Reference This method is an alias of the :doc:`config file loading method <config>`: ``$this->config->load()`` + .. method:: is_loaded($class) + + :param string $class: Class name + :returns: mixed + + Allows you to check if a class has already been loaded or not. + + .. note:: The word "class" here refers to libraries and drivers. + + If the requested class has been loaded, the method returns its assigned + name in the CI Super-object and FALSE if it's not:: + + $this->load->library('form_validation'); + $this->load->is_loaded('Form_validation'); // returns 'form_validation' + + $this->load->is_loaded('Nonexistent_library'); // returns FALSE + + .. important:: If you have more than one instance of a class (assigned to + different properties), then the first one will be returned. + + :: + + $this->load->library('form_validation', $config, 'fv'); + $this->load->library('form_validation'); + + $this->load->is_loaded('Form_validation'); // returns 'fv' + .. method:: add_package_path($path[, $view_cascade = TRUE]) :param string $path: Path to add |