Welcome Guest, Not a member yet? Register   Sign In
[HOW] CI Works
#9

[eluser]4ever[/eluser]
[quote author="n0xie" date="1306169312"]
Quote:I don't understand why they didn't place this declaration to class not into the method. I would do it so and accessed like so:
$this->_is_loaded[strtolower($class)] = $class;
Because it's a globally scoped function, not a class property.
[/quote]

Oh. I didn't see. Common.php isn't class.

[quote author="n0xie" date="1306169312"]
Quote:I understand. Every item ($_classes) in the array is string, right?
No every item is an object
[/quote]
I see now L166:
Code:
$_classes[$class] = new $name();

OK. So new object with class name $name is added to the array $_classes.
And then it is returned L167. But this object is not accessible from super object. Hence it is returned by function load_class (common.php).

Code:
return $_classes[$class];

That is the &load;_class. Clear.

[quote author="n0xie" date="1306169312"]Not all classes that are loaded are accessible through the CI superobject. Hence the difference[/quote]
I guess I should to see the difference between $_classes in global scoped function and $ci_classes in super object. In loader.php is used $ci_classes, in common.php is used $_classes...


Messages In This Thread
[HOW] CI Works - by El Forum - 05-23-2011, 01:12 AM
[HOW] CI Works - by El Forum - 05-23-2011, 01:15 AM
[HOW] CI Works - by El Forum - 05-23-2011, 01:26 AM
[HOW] CI Works - by El Forum - 05-23-2011, 04:01 AM
[HOW] CI Works - by El Forum - 05-23-2011, 04:10 AM
[HOW] CI Works - by El Forum - 05-23-2011, 04:18 AM
[HOW] CI Works - by El Forum - 05-23-2011, 04:34 AM
[HOW] CI Works - by El Forum - 05-23-2011, 05:48 AM
[HOW] CI Works - by El Forum - 05-23-2011, 06:27 AM
[HOW] CI Works - by El Forum - 05-23-2011, 08:29 AM
[HOW] CI Works - by El Forum - 05-23-2011, 09:32 AM
[HOW] CI Works - by El Forum - 05-23-2011, 11:30 AM
[HOW] CI Works - by El Forum - 05-23-2011, 12:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB