Welcome Guest, Not a member yet? Register   Sign In
What to do???
#7

[eluser]bretticus[/eluser]
[quote author="sudinem" date="1268779382"]How to call model's function inside the helper function???[/quote]

Why do you need to call it from a helper function? Why not call it directly?

the answer is, of course, to get an instance of the CI super object.

Code:
function some_helper_func()
{
  $CI =& get_instance();
  $CI->load->model('your_model');
  $CI->your_model->some_model_func();
}


Messages In This Thread
What to do??? - by El Forum - 03-15-2010, 08:57 AM
What to do??? - by El Forum - 03-15-2010, 09:01 AM
What to do??? - by El Forum - 03-15-2010, 10:50 PM
What to do??? - by El Forum - 03-15-2010, 10:55 PM
What to do??? - by El Forum - 03-15-2010, 11:03 PM
What to do??? - by El Forum - 03-16-2010, 11:43 AM
What to do??? - by El Forum - 03-16-2010, 11:48 AM
What to do??? - by El Forum - 03-16-2010, 12:45 PM
What to do??? - by El Forum - 03-16-2010, 01:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB