[TYPO3-project-formidable] New method for the new template engine
Manuel Rego Casasnovas
mrego at igalia.com
Tue Feb 5 13:08:15 CET 2008
Hello,
I've developed a new method to call function number_format [1] from my
templates.
I only have to add the next lines to "tx_ameosformidable":
case "number_format": {
$number =
tx_ameosformidable::templateDataAsString($mData);
if (is_numeric($number)) {
return number_format($number,
$aParams[0], $aParams[1], $aParams[2]);
}
return $mData;
}
And I can call this function in my template, e.g.:
{my_rdt.number_format()}
But I have a problem when I try to pass params to my function. I can
pass params like ".", e.g.:
{my_rdt.number_format("0", ".", ".")}
However if I try to pass a param "," I get four params, two of them are
empty params, e.g.:
{my_rdt.number_format("0", ",", ".")}
I get a params array like array("0", "", "", ".").
I think that the problem is in the function "executeTemplateMethod",
when this function bulds the params array.
Best regards,
Rego
[1] http://es.php.net/number_format
--
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com
More information about the TYPO3-project-formidable
mailing list