Hi all,
I'm writing a custom function to add to my Volt compiler. This function is called like this:
{{ icon("times",["style":"solid"]) }}
The second argument is an array that can have a number of different properties defined. Accessing the first argument is pretty straightforward with
$expr[0]['expr']['value']
However, the second parameter appears to be broken up into a complex abstract syntax tree. Here's the exprArgs
:
Array
(
[0] => Array
(
[expr] => Array
(
[type] => 260
[value] => pencil
[file] => /path/to/file
[line] => 88
)
[file] => /path/to/file
[line] => 88
)
[1] => Array
(
[expr] => Array
(
[type] => 360
[left] => Array
(
[0] => Array
(
[expr] => Array
(
[type] => 260
[value] => solid
[file] => /path/to/file
[line] => 88
)
[name] => style
[file] => /path/to/file
[line] => 88
)
)
[file] => /path/to/file
[line] => 88
)
[file] => /path/to/file
[line] => 88
)
)
Now, I can still access that with
$expr[0]['expr']['left']['0']['expr']['value']
but that seems kind of brittle and excessive.
Is there any way to simply get the arguments as they were passed?
I'm running v3.4