XF 1.5 Can't pass a parameter to xen:callback

rhodes

Active member
Hello,

I've defined a template "my_template" including a xen:callback tag passing a string parameter.

Code:
<xen:callback class="myClass" method="myfunction" params="{$var}"></xen:callback>

$var is defined, I can print it in my_template with {$var}. Also myfunction is called successfully. However, it seems as if the parameter is not passed to the function.


Code:
    public static function myfunction($para) {
       //do sth with $para and return sth.
      // $para is empty
       ...
    }

Any idea how I can solve this?

regards, rhodes
 
Params takes an array of parameters. You should do something like {{ [$var] }}. (I don't actually think the double curlies are even necessary as this is a "forced expression" syntax area.)
 
Top Bottom