From 2ede2f6e8e9f2cde7402a88906d091011f7885ec Mon Sep 17 00:00:00 2001
From: Derek Jones Directory access is forbidden.
This function is an alias of the config file loading function: $this->config->load()
+An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the system/application/third_party folder. Below is a sample map of an package directory
+ + +The following is an example of a directory for an application package named "Foo Bar".
+ +/system/application/third_party/foo_bar
+
+config/
+helpers/
+language/
+libraries/
+models/
+
+
+Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.
+ +Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:
+ +$this->load->add_package_path(APPPATH.'third_party/foo_bar/');
+$this->load->library('foo_bar');
+
+When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.
+ +Or to remove a specific package path, specify the same path previously given to add_package_path() for a package.:
+ +$this->load->remove_package_path(APPPATH.'third_party/foo_bar/');
+
+@todo - package view file interface is not complete. It can be experimentally used by first saving the Loader's original view path, setting the view path to the package's view path, and when finished, setting back to the original view path.
+ +// ... save the original view path, and set to our Foo Bar package view folder
+$orig_view_path = $this->load->_ci_view_path;
+$this->load->_ci_view_path = APPPATH.'third_party/foo_bar/views/';
+
+// ... code using the package's view files
+
+// ... then return the view path to the application's original view path
+$this->load->_ci_view_path = $orig_view_path;
--
cgit v1.2.3-24-g4f1b