05-07-2008, 05:04 AM
|
#11 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Okay, so I'm into the section of the Reflection API in my book now. You could've told me your code works just as is! haha.
PHP Code:
if (!array_key_exists($szClass, self::$Library)) {
if (is_array($mArgs)) { $pReflect = new ReflectionClass($szClass); self::$Library[$szClass] = $pReflect->newInstanceArgs($mArgs); } else { self::$Library[$szClass] = new $szClass($mArgs); }
}
and now I can do
PHP Code:
$pMultiple = kePhoto::load("test", "multiple", array("one", "two", "three"));
or
$pSingle = kePhoto::load("test", "single", "one");
and it works great! Thank you Salathe.
-m
|
|
|
|