diff options
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 |