Welcome Guest, Not a member yet? Register   Sign In
Simple Helper Question.
#1

[eluser]Temple[/eluser]
If possible, how can I use controller functions, such as $this->db->query in my helper file?
#2

[eluser]xwero[/eluser]
you need to add
Code:
$ci =& get_instance();
And then you can do
Code:
$ci->db->query
#3

[eluser]Temple[/eluser]
Fantastic, thank you for the quick reply.
#4

[eluser]Ricardo Rodrigues[/eluser]
At last I see this answer!!!

Why this VERY USEFUL information is not in the Helper class info??!
#5

[eluser]wiredesignz[/eluser]
Probably because it's not good practice to use the $CI object in helpers.




Theme © iAndrew 2016 - Forum software by © MyBB