trying to port web app starter from PHP
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
DTree card_props;
|
||||
card_props["title"] = "Component Example";
|
||||
card_props["body"] = "This card body comes from context.call and is rendered through component().";
|
||||
|
||||
DTree named_props;
|
||||
named_props["title"] = "Named Render Example";
|
||||
named_props["body"] = "This content is rendered through the RENDER:BODY(Request& context) entry point.";
|
||||
|
||||
<>
|
||||
<link rel="stylesheet" href='style.css?v=<?= time() ?>'></link>
|
||||
<h1>
|
||||
<a href="index.uce">UCE Test</a>:
|
||||
Components
|
||||
</h1>
|
||||
<p>
|
||||
component_exists("components/card"):
|
||||
<strong><?= component_exists("components/card") ? "true" : "false" ?></strong>
|
||||
</p>
|
||||
<p>
|
||||
component_resolve("components/card"):
|
||||
<code><?= component_resolve("components/card") ?></code>
|
||||
</p>
|
||||
<h2>Default Render</h2>
|
||||
<div>
|
||||
<?: component("components/card", card_props, context) ?>
|
||||
</div>
|
||||
<h2>Named Render</h2>
|
||||
<? render_component("components/card:BODY", named_props, context); ?>
|
||||
</>
|
||||
}
|
||||
Reference in New Issue
Block a user