Custom library question, for clarification? |
[eluser]whygod[/eluser]
Hi I just want to clarify my understanding. Okay the User Manual says, to utilize CodeIgniter Resources within a Library. I need to do it like this below, Code: $CI =& get_instance(); So meaning when extending the MY_Controller below is not right? MY_Controller: Code: <?php Custom library: Jaz_lib.php Code: <?php Meaning the classes that was loaded in the MY_Controller, will not be inherited in Jaz_lib library? Thanks in advanced.
[eluser]whygod[/eluser]
Also is it necessary to include a __constructor in a custom library? Or no need anymore?
[eluser]LuckyFella73[/eluser]
In Codeigniter libraries are standalone classes - they don't extend any controller class! For the constructor question: you don't have to set it up in general but you need it if you want to pass arguments when loading the library. ## EDIT: or if you want to run some code when the class is instantiated. ## See userguide: http://ellislab.com/codeigniter/user-gui...aries.html |
Welcome Guest, Not a member yet? Register Sign In |