I'm porting a bit of perl to php and am emulating the perl hash table. I
asked about this before, but I've since lost my way.
What I have is this (in a class):
if(function_exi sts($CUSTOM['some_key'])){
return $CUSTOM['some_key']($this,$some_pa ram);
}
Now, I can do this:
$CUSTOM['some_key'] = create_function ('$obj,$somepar am','return
"something done here";');
What I'd like to do is point this at a function in a class elsewhere,
in pseudo code:
$CUSTOM['some_key'] = {
require_once ('some_module') ;
function_in_som e_module($obj, $some_param);
};
I have some notion that this can be done with: call_user_func_ array,
but I can't quite grok the syntax. Help!
Jeff
asked about this before, but I've since lost my way.
What I have is this (in a class):
if(function_exi sts($CUSTOM['some_key'])){
return $CUSTOM['some_key']($this,$some_pa ram);
}
Now, I can do this:
$CUSTOM['some_key'] = create_function ('$obj,$somepar am','return
"something done here";');
What I'd like to do is point this at a function in a class elsewhere,
in pseudo code:
$CUSTOM['some_key'] = {
require_once ('some_module') ;
function_in_som e_module($obj, $some_param);
};
I have some notion that this can be done with: call_user_func_ array,
but I can't quite grok the syntax. Help!
Jeff
Comment