Page 1 of 1

get functions return

Posted: Sun Apr 08, 2007 5:29 pm
by dall
I'm writing template system, template system gets function name,
so I have to get function result in array to replace it.
how to do something like this?

Code: Select all

function function_result($function)
{
    $f = call_user_func($function);
    return $f;
}
I need to hold function result to use it letter.

Thanks.

Posted: Sun Apr 08, 2007 5:32 pm
by feyd
I don't understand. Please explain further.

Posted: Sun Apr 08, 2007 5:39 pm
by dall
ok.

in database table I have functions names like 'xx_xxx2', it is block
in template file I have [REQ_x], I need to replace [REQ_x] with functions, who are in 'x' region.

Only problem that I have, I don't know how to hold function return, to use it letter(cache, etc.).

Posted: Sun Apr 08, 2007 6:03 pm
by feyd
Your example posted above stores a function return into a variable. I don't see the mystery that you're finding.