12-02-2010, 01:00 PM
El Forum
12-02-2010, 01:41 PM
[eluser]techgnome[/eluser]
It's in the documentation: http://ellislab.com/codeigniter/user-gui...asses.html
It's in the documentation: http://ellislab.com/codeigniter/user-gui...asses.html
El Forum
12-02-2010, 01:46 PM
[eluser]laytone[/eluser]
[quote author="techgnome" date="1291340484"]It's in the documentation: http://ellislab.com/codeigniter/user-gui...asses.html[/quote]
Maybe my question was not clear?
I know how to extend the core classes. What I want to do is extend the CI_Base class with a class in my library folder.
Right now if you want to access variable in CI you have to use the =& get_instance() method... which is fine, just extra work. I'm wondering if i could extend CI_Base and access the CI variables with $this->db or $this->whatever. Is this legal?
[quote author="techgnome" date="1291340484"]It's in the documentation: http://ellislab.com/codeigniter/user-gui...asses.html[/quote]
Maybe my question was not clear?
I know how to extend the core classes. What I want to do is extend the CI_Base class with a class in my library folder.
Right now if you want to access variable in CI you have to use the =& get_instance() method... which is fine, just extra work. I'm wondering if i could extend CI_Base and access the CI variables with $this->db or $this->whatever. Is this legal?
El Forum
12-02-2010, 01:59 PM
[eluser]WanWizard[/eluser]
You can extend any class, but you'll just be creating another instance of that class, you'll still have to use get_instance(), or assign all properties to the CI object to your new class manually.
You can extend any class, but you'll just be creating another instance of that class, you'll still have to use get_instance(), or assign all properties to the CI object to your new class manually.
El Forum
12-02-2010, 02:04 PM
[eluser]laytone[/eluser]
[quote author="WanWizard" date="1291341550"]You can extend any class, but you'll just be creating another instance of that class, you'll still have to use get_instance(), or assign all properties to the CI object to your new class manually.[/quote]
I understand, and that makes a lot of sense. Thank you.
[quote author="WanWizard" date="1291341550"]You can extend any class, but you'll just be creating another instance of that class, you'll still have to use get_instance(), or assign all properties to the CI object to your new class manually.[/quote]
I understand, and that makes a lot of sense. Thank you.