Welcome Guest, Not a member yet? Register   Sign In
Accessing a driver's functions through the child drivers
#1

[eluser]Haskabab[/eluser]
Okay so i have a driver structure setup like this:

Quote:Libraries \ Character \ Character.php <b>Main driver</b>
Libraries \ Character \ drivers \ Character_actions.php <b>Child driver</b>

Now the "character" (main) driver has the function <b>Get()</b> which gets all the character's information.

Then in "character_actions" i want to perform the actions for that character. Now to do that i want to get the character info without rewriting that function and just call it from the parent driver.

I've tried <b>Parent::get()</b>, and i get the error message: No such method 'get'.

I couldn't find a lot of information about drivers anyways (only how the folder structure works) so that's why i'm asking here.

So if you know how to call parent functions from the child drivers, please share Big Grin!

Thanks in advance

<b>Edit:</b> using <b>$this->ci->character->get();</b> in the child driver works, but i wonder if this is the best or the 'correct' way to do it. Any feedback is still welcome!




Theme © iAndrew 2016 - Forum software by © MyBB