Welcome Guest, Not a member yet? Register   Sign In
ulr helper

How to load the model in helper,
it is possible,please help me.
Thanks Regards

A model in a helper? You can load a model, or a helper. Or a library, and so on.

Either load a model from your controller with $this->load->model('some_model'); - put it in the construct if you want multiple methods to be able to use it, or put it directly in a controller method.

Or you can autoload it. Add it to the load model array in your autoload file like so:

$autoload['model'] = array('some_model');

To load a model in a helper you need to get the CI super object instance!

To see how this is done refer to the url_helper.php in system/helpers/url_helper.php


What would be the practical purpose of loading a model in a helper?

Search the forums.

Theme © iAndrew 2016 - Forum software by © MyBB