Welcome Guest, Not a member yet? Register   Sign In
Loading libraries in controller vs. loading in CI instance
#1

[eluser]Maarten Troonbeeckx[/eluser]
I'm a bit confused... :/

In my controller I do the following:

Code:
class Index extends Controller
{

    ...

    public function index()
    {
        $this->load->library('Shop_Front', null, 'shop');
    }

    ...

}

Then in one of my libraries, this happens:

Code:
class MY_Library
{

    ...
    
    $CI =& get_instance();
    $CI->load->library('Shop', null, 'shop');

    ...

}

I was under the impression that I would override the 'shop' object name, since I define it in two places. I thought $CI->shop == $this->shop (in controller)...

So not every library you load in the controller is available in the CI instance or vice versa, right?

I'm clearly missing something here...
Can somebody enlighten me a bit Wink

Grtz, M.


Messages In This Thread
Loading libraries in controller vs. loading in CI instance - by El Forum - 07-20-2010, 09:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB