0

RE: Parsing JSON in EE tag

Can anyone help out here? It seems that since EE uses { and } that it interperets JSON as an EE tag.

I need to pass JSON to a plugin, how is that possible?

3 Answers 3

0

I 'm wondering if you are preparing JSON data within the template and would like to pass within a plugin via plugin parameter.

Rather than it, just access that object or array within plugin and use PHP's function json_encode

3
  • Right, that's what I was thinking too after the param didn't work. Simply set the json string to memory, and retrieve it with the plugin and parse the json in the tagdata. It's super simple. Aug 1, 2013 at 15:37
  • No, I'm passing JSON TO the template and trying to pass it to the plugin.
    – MB34
    Aug 1, 2013 at 17:30
  • Can you share the code how you are passing within the template. Also, share how you are getting the JSON data within the template. Aug 1, 2013 at 18:08
0

Since I figured out that i can pass the javascript object to the template and do my parsing there, I decided to forego messing with the JSON in the template. I still handle the JSON in my plugin but I'm taking the passed parameters and building the JSON from it.

Thanks for the help and comments.

0

I had the same problem. in my case I store the JSON data in a felid, but before I save it I do php STR_REPLACE {} to <>. while decoding to php array I do reverse the <> to {}. it works fine with me . hope you find this helpful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.