Welcome Guest, Not a member yet? Register   Sign In
Library Question
#1

[eluser]Vik[/eluser]
I moved a function that's used by two of my models, to a library file. The function uses the DB object, so the following line doesn't run yet:
Code:
$this->db->where('id=', $user_id);
To make DB available to the function, is the correct approach, to pass in DB as a parameter of the function?
#2

[eluser]Derek Allard[/eluser]
You bet. Take a look at Utilizing CodeIgniter Resources within Your Library.
#3

[eluser]Vik[/eluser]
Cool! Thanks, Derek.
#4

[eluser]Derek Allard[/eluser]
My pleasure vik




Theme © iAndrew 2016 - Forum software by © MyBB