View Single Post
Old 05-07-2008, 05:04 AM   #11 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

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($szClassself::$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
delayedinsanity is offline  
Reply With Quote