01397: Skin: function directive re-uses arguments

Summary: Skin: function directive re-uses arguments
Created: 2016-11-26 06:06
Status: Closed, not a bug
Category: Bug
From: Sven
Assigned:
Priority: 4
Version: 2.2.62
OS: Ubuntu, Apache/2.4.10, PHP 5.5.9

Description: In my skin template, I have two <!--function: --> directives with different arguments. I verified with a counter variable that my function is called twice, but both times it gets the arguments of the first directive the page name being loaded as its argument, instead of the data in the directive.

Sven November 26, 2016, at 06:08 AM

The pagename is always the first argument; the data from the directive is passed as a second argument for you to parse. --Petko November 26, 2016, at 06:30 AM

Thanks! I must have missed the plural s in "arguments" when I read SkinTemplates. I suggest to rephrase the description to stress the number of arguments: "This directive calls a PHP function named "SomeFunction", always passing exactly two arguments: The current page's name and the entire text following the function name as arguments." — Sven December 20, 2016, at 06:17 AM

If you feel this could have been better documented somewhere in the PmWiki group, you can add this information where you expected it to be. --Petko December 20, 2016, at 09:05 AM