problem passing variables
| From: | Tomas Sanchez Romani | Date: | Thu, 10 May 2001 09:22:52 +0000 |
| Subject: | problem passing variables | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-711@lists.php.net to get a copy of this message | ||
Hi, I'm having trouble with passing variables to a custom function I'm
trying to do.
---the function:
/*============================================*\
Function: smarty_func_translate
Purpose: translate the string ($strId) with STPhp
\*============================================*/
function smarty_func_translate($strId, $toStr, $locLang, $locPath, $locMech)
{
include("../stphp/code/st/st.php");
global $LocalePath, $LocaleMechanism;
$LocalePath = $locPath;
$LocaleMechanism = $locMech;
eval (ST ($strId, "\$toStr", $locLang));
echo $toStr;
}
---the call from within the tamplate:
{translate locLang=$locLang locPath=$locPath locMech=$locMech strId=$strId
toStr=$toStr}
---the assigning from the script:
$smarty->assign("locLang", $locLang);
$smarty->assign("locMech", $locMech);
$smarty->assign("toStr", $toStr);
$smarty->assign("strId", $strId);
$smarty->assign("locPath", $locPath);
---the result:
Warning: Missing argument 3 for smarty_func_translate()
in Smarty.addons.php on line 45
Warning: Missing argument 4 for smarty_func_translate()
in Smarty.addons.php on line 45
Warning: Missing argument 5 for smarty_func_translate()
in Smarty.addons.php on line 45
---the question:
what's wrong?
please help, a&l, tomas