The CI helper does not have access to the controller resources by default unless CI and get_instance()
are called and used to access CI resources.
We can extend the CI helper using third-party helpers from the CI system' or we can develop our own helper.
Any application helper should be located under application/helpers/
in the project directory.
The helper file must be in the following format:
application/helpers/<HELPER_NAME>_helper.php
For example, the SSL helper file should appear as application/helpers/ssl_helper.php
.
The helper integration and usage within the CI project is as follows:
Add the helper code resources to
application/helpers/myhelper_helper.php
Load the helper automatically or via the controller
Automatically load a helper
myhelper
for all CI projects as follows:$autoload['helper'] = array('url','myhelper');
For loading in certain specific controllers, constructors, or methods, use the following:
$this->load->helper('myhelper');
Use the...