Skip to content

Instantly share code, notes, and snippets.

@steveosoule
Forked from mghdotdev/MvCALL-with-JSON.xml
Last active August 29, 2015 14:26
Show Gist options
  • Save steveosoule/78f575e5c304dc8720a5 to your computer and use it in GitHub Desktop.
Save steveosoule/78f575e5c304dc8720a5 to your computer and use it in GitHub Desktop.
MVT: MvCALL with JSON
<mvt:comment>Define JSON holding variable</mvt:comment>
<mvt:assign name="l.settings:json" value="''" />
<mvt:comment>Define URL Variable</mvt:comment>
<mvt:assign name="g.url" value="'http://example.com/'" />
<mvt:comment>Call `g.url` and Concatenate `s.callvalue` into `l.settings:json`</mvt:comment>
<mvt:call action="g.url" method="'GET'">
<mvt:assign name="l.settings:json" value="l.settings:json $ s.callvalue" />
</mvt:call>
<mvt:comment>Parse JSON -> Miva Array Structure</mvt:comment>
<mvt:assign name="l.success" value="miva_json_decode( l.settings:json, l.settings:miva_structure_variable )" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment