codeigniter load library from within library |
[eluser]haily_php[/eluser]
In codeigniter, what can I do to load library from within library? Please help me.
[eluser]InsiteFX[/eluser]
Code: private $CI; InsiteFX
[eluser]bientek[/eluser]
get_instance seems to be undefined in the context of a library that replaces a CI native library. For example, in MY_Log... Code: function MY_Log() ...produces: "Fatal error: Call to undefined function get_instance()..."
[eluser]CroNiX[/eluser]
your parent::CI_Log() should be parent::__construct(), and it should be in a __construct() itself, just like InsiteFX showed you. See the manual for Creating Libraries, especially the Replacing Native Libraries with Your Versions section You aren't extending/replacing the native library correctly.
[eluser]bientek[/eluser]
Sorry, that's 1.7.2 code there. Regardless, one still cannot use get_instance() when replacing a native library, at least in this case.
|
Welcome Guest, Not a member yet? Register Sign In |