Hi everyone!
I try to add a custom function ti use it in Volt. I've got this thing i hardly understand. If i dump my variables, it has two simple quote before and after for a string, the type is an array for an integer... Here is a simple exemple :
$compiler->addFunction('test', function($string,$length) {
var_dump($string);
var_dump($length);
exit;
});
And here is the the call in Volt :
{{ test ("test","20") }}
And the result is :
string ''test', '20'' (length=20)
array (size=2)
0 =>
array (size=3)
'expr' =>
array (size=4)
'type' => int 260
'value' => string 'test et test' (length=12)
'file' => string '/home/alex/......' (length=69)
'line' => int 1
'file' => string '/home/alex/.....' (length=69)
'line' => int 1
1 =>
array (size=3)
'expr' =>
array (size=4)
'type' => int 260
'value' => string '20' (length=2)
'file' => string '/home/alex/.....' (length=69)
'line' => int 1
'file' => string '/home/alex/.....' (length=69)
'line' => int 1 **
For sure there is something i can't find in documentation about how passing variable to a custom function!