Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!

Jcon.parse

Jcon.parse($text)

Description

Parse a JCON string and return the data as a List or Map.

TIPInstead of this method, we recommended you either define JCON as a Jcon template, or parse a file in the settings directory with Jcon.parseFile().

$postJcon = File.read('newsUpdates.jcon');
$posts = Jcon.parse($postJcon);

$posts[0].title;
//= 'Updated the Logo'

//--- file: files/newsUpdates.jcon ---

[
    {
        title: Updated the Logo
        date: July 17, 2019
    }
    {
        title: New Feed Page
        date: June 8, 2019
    }
    {
        title: Server Upgrade
        date: April 4, 2019
    }
]

See Also