method and it's children organizational confusion
-
S. Shehzed
Follow driver_example. Children have access to parent's methods, but not one another's (obviously).
The main driver extends CI_Driver_Library. Children extend CI_Driver. If you want common or semi-common methods and variables among children methods you can use interfaces.
__constructor()should have:$this->valid_drivers[] = 'Blah_One'; $this->valid_drivers[] = 'Blah_Two';Don't need to load children. Just load the parent:
$this->load->driver('Document');Structure of files should be:
Base directory: ParentName
File in directory: ParentName.
Directory in base, alongside file above: drivers
Files in drivers:
- ParentName_One - ParentName_TwoWill call children by doing this:
$this->ParentName->One->method(); -
S. Shehzed
- State changed from active to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.