Welcome Guest, Not a member yet? Register   Sign In
Loading CI instance inside helper, causes problem in library?
#6

[eluser]tkrop[/eluser]
I understand the confusion...

This is what happens:

1. CustomLib and customhelper are autoloaded.
2. I call <?=customhelper()?> in code
3. customhelper() creates $CI variable (function scope) by reference
4. customhelper() calls $CI->customlibrary->User() function
5. CustomLibrary constructor creates $CI variable (class scope) by reference

The CustomLibrary->User() function then calls '$this(->user)', which should point to the CustomLibrary instance. However '$this' contains the $CI reference and $this->user only exists in CustomLibrary...


Messages In This Thread
Loading CI instance inside helper, causes problem in library? - by El Forum - 04-06-2010, 03:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB