For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > February 2007 > function call within function call









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author function call within function call
Peggy Schatz

2007-02-09, 7:11 pm

Hello,

I'm looking for possibly combining two plugins.

Depending on the assigned variable {$actype} I want to retrieve related
data from a database by using function {get_supplier} and use the result
as parameter for function {checkfield}

***
The way it worked before (all supplier data in array and assigned as
$supplier_default):

{checkfield data=$supplier value=$supplier_value
default=$supplier_default.$actype}

***
The way I'd rather have it to work (but it doesn't):

{checkfield data=$supplier value=$supplier_value
default=get_supplier($actype)}

function smarty_function_get_supplier($params, &$smarty)
{
/* database query */
$res=array(1,2,3);
return $res;
}

***
Both functions are named right (function.checkfield.php,
function.get_supplier.php) in the assigned plugins-directory.

Is a function call within a function call possible? What'd be the proper
syntax to achieve the desired?

Thanks and greetings,
Peggy
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com