Friday 14 November 2003 8:45:38 am
Hello, I am trying to create a random template operator (or function not sure which) that mimics the PHP rand function. I am using ezp3.2-3, looking at the code and the example Custom template operators they don't match. So I found in the code that template.ini can define the mapping to PHP functions to template functions (or operators). So I added this line to the template.ini file: PHPOperatorList[random_number]=rand turned on debug, added the following line to a template file:
{let var=23}
{$var}
{$var|random_number} {/let} The debug gives me the following message: Warning: PHP Nov 14 2003 15:52:22 rand() expects exactly 2 parameters, 1 given in /var/www/html/ezpublish-3.2-3/lib/eztemplate/classes/eztemplatephpoperator.php on line 86 So I tried the following line in my template file:
{let var=45}
{$var}
{random_number(0,$var} {/let} This produces the exact same debug output. So it seems that functions which can be mapped in the template.ini file are PHP functions that take only 1 parameter. How do I map a function that takes more than 1 parameter? Thanks
|