Hello everyone,
The new parser (GreenToken) will support passing arrays to a snippet/widget in the following proposed format:
This will pass in $names as an index array
[[Widget? &names[]=`mary` &names[]=`James`]]
This will pass in $colors as an associate array
[[Widget? &colors[red]=`#ff0000` &colors[blue]=`#0000ff`]]
The format might change slightly but what do you think about the idea of being able to pass arrays to a snippet. Think it will ever come in handy?
The more I read your post about the new parser, the more I think I am going to like it a lot
I don’t fully grasp what it means yet, but I am pretty interrested !
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Quote from: Djamoer at Feb 15, 2006, 10:12 AM
Raymond, I think the second example will need 2 input, the one for the key and the other one for the value, maybe something like this will work.
[[Widget? &colors[red]=`#ff0000` &colors[blue]=`#0000ff`]]
You’re correct.
I had it like that in the post but SMF converted it into colors