creating more than one extension to a core library class |
[eluser]doehoe[/eluser]
I'm a bit of a newbie to CI , so please excuse any ignorance I understand that it is possible to extend the core classes (according to http://ellislab.com/codeigniter/user-gui...asses.html). However, what if you want to create more than one extension to the same class? As far as I see it, if we are using the Input class for example, since the subclass has to be named MY_Input we have no way of creating two different subclasses of Input. Is there a way around this, or is there a proper way of creating two or more subclasses of a core library class?
[eluser]Adam Griffiths[/eluser]
Why can't you have multiple edits to the class in one file?
[eluser]dcunited08[/eluser]
[quote author="Adam Griffiths" date="1224998073"]Why can't you have multiple edits to the class in one file?[/quote] This is currently what I do. I extend Controller in multiple ways and have them all in the same file.
[eluser]xwero[/eluser]
The MY_ prefix is to automatically load the extended library. I'm not sure if it will work but you can try to put the two extending classes in the MY_Input.php file and then you have to instantiate them yourself. Code: // MY_Input.php
|
Welcome Guest, Not a member yet? Register Sign In |