uce/test/json.uce
2021-11-15 09:18:00 +00:00

45 lines
735 B
Plaintext

RENDER()
{
DTree t;
<>
<link rel="stylesheet" href='style.css'></link>
<h1>
<a href="index.uce">UCE Test</a>:
DTree/JSON
</h1>
JSON:
<pre style="white-space: pre-wrap"><?
t.key("a")->set("valueA");
t.key("b")->set("valueB");
t.key("c")->key("c-d")->set("valueCD");
t.key("c")->key("c-e")->set("valueCE");
t.key("c")->key("c-f")->set(&t);
t.key("g")->key("g-h")->key("h-i")->set("valueHI");
t["g"]["x"]["y1"] = "XYZ1";
t["g"]["x"]["y2"] = &t;
t["g"]["x"]["y3"] = time();
t["g"]["x"]["y4"] = "Ünicödä";
string j;
echo(j = json_encode(t));
?></pre>
Parsed:
<pre><?
echo(var_dump(json_decode("1")));
?></pre>
Params
<pre><?= var_dump(context->params) ?></pre>
</>
}