30 lines
690 B
Plaintext

#load "lib/app.uce"
RENDER(Request& context)
{
starter_boot(context);
DTree resolved = starter_resolve_view(context);
ob_start();
if(resolved["file"].to_string() != "")
{
if(resolved["param"].to_string() != "")
context.var["starter"]["route"]["param"] = resolved["param"];
unit_render(resolved["file"].to_string(), context);
}
else
{
starter_not_found("The requested page does not exist.", context);
<>
<section class="card">
<h1>404 Not Found</h1>
<p><?= context.var["starter"]["error"].to_string() ?></p>
</section>
</>
}
String main_html = ob_get_close();
context.var["starter"]["fragments"]["main"] = main_html;
starter_render_page(context);
}