From 81dd22393368862760e1cfb30a0d73d070cd38af Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Fri, 18 Nov 2011 20:49:35 -0600 Subject: add method get_vars() to CI_Loader to retrieve all variables loaded with $this->load->vars() --- system/core/Loader.php | 14 ++++++++++++++ user_guide_src/source/changelog.rst | 1 + user_guide_src/source/libraries/loader.rst | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/system/core/Loader.php b/system/core/Loader.php index 4e14b54af..d42dbbf38 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -494,6 +494,20 @@ class CI_Loader { // -------------------------------------------------------------------- + /** + * Get Variables + * + * Retrieve all loaded variables + * + * @return array + */ + public function get_vars() + { + return $this->_ci_cached_vars; + } + + // -------------------------------------------------------------------- + /** * Load Helper * diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index a071e5a66..49468e015 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -50,6 +50,7 @@ Release Date: Not Released - Changed private functions in CI_URI to protected so MY_URI can override them. - Removed CI_CORE boolean constant from CodeIgniter.php (no longer Reactor and Core versions). + - Added method get_vars() to CI_Loader to retrieve all variables loaded with $this->load->vars() Bug fixes for 3.0 ------------------ diff --git a/user_guide_src/source/libraries/loader.rst b/user_guide_src/source/libraries/loader.rst index bbe2ed530..2090404bf 100644 --- a/user_guide_src/source/libraries/loader.rst +++ b/user_guide_src/source/libraries/loader.rst @@ -165,6 +165,12 @@ This function checks the associative array of variables available to your views. This is useful if for any reason a var is set in a library or another controller method using $this->load->vars(). +$this->load->get_vars() +=========================== + +This function retrieves all variables available to +your views. + $this->load->helper('file_name') ================================= -- cgit v1.2.3-24-g4f1b