30 lines
665 B
Plaintext
30 lines
665 B
Plaintext
#load "lib/app.uce"
|
|
|
|
RENDER(Request& context)
|
|
{
|
|
app_init(context);
|
|
|
|
DTree resolved = app_resolve_view(context);
|
|
|
|
ob_start();
|
|
if(resolved["file"].to_string() != "")
|
|
{
|
|
if(resolved["param"].to_string() != "")
|
|
context.var["app"]["route"]["param"] = resolved["param"];
|
|
unit_render(resolved["file"].to_string(), context);
|
|
}
|
|
else
|
|
{
|
|
app_not_found("The requested page does not exist.", context);
|
|
<>
|
|
<section class="card">
|
|
<h1>404 Not Found</h1>
|
|
<p><?= context.var["app"]["error"].to_string() ?></p>
|
|
</section>
|
|
</>
|
|
}
|
|
String main_html = ob_get_close();
|
|
context.var["app"]["fragments"]["main"] = main_html;
|
|
app_render_page(context);
|
|
}
|