jferrandis
8 years agoExpert
Convert a string into a json object
Hi all
Is there a way to convert a string into a json object.
My case is this one.
To handle multiple winners in contest, i use the annoucement field where a i put a formatted message : "{winners:[{id:xx),{id:yy},...],order:true}"
when a get the data with an API call, result is a string. The only way to "convert" it a json is to put an ?eval which is quite ugly and causes some freemarker errors
Is there custom freemarker builts-in to make this?
Thank you for your help