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

[eluser]jons[/eluser]
hi
How to load the model in helper,
it is possible,please help me.
Thanks Regards
Babasaheb
#2

[eluser]Arministrator[/eluser]
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');
#3

[eluser]InsiteFX[/eluser]
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

InsiteFX
#4

[eluser]Arministrator[/eluser]
What would be the practical purpose of loading a model in a helper?
#5

[eluser]InsiteFX[/eluser]
Search the forums.




Theme © iAndrew 2016 - Forum software by © MyBB