refactor: rename DTree to DValue

This commit is contained in:
udo
2026-06-12 11:05:52 +00:00
parent 941f5aea08
commit 7066da3cde
157 changed files with 1203 additions and 1074 deletions
+7 -7
View File
@@ -1,19 +1,19 @@
#load "lib/app.uce"
DTree starter_router_result(String file, String param = "")
DValue starter_router_result(String file, String param = "")
{
DTree result;
DValue result;
result["file"] = file;
if(param != "")
result["param"] = param;
return(result);
}
DTree starter_router_resolve(Request& context)
DValue starter_router_resolve(Request& context)
{
String lpath = context.call["route"]["l_path"].to_string();
if(lpath == "")
return(DTree());
return(DValue());
String exact = "views/" + lpath + ".uce";
if(file_exists(exact))
@@ -34,14 +34,14 @@ DTree starter_router_resolve(Request& context)
return(starter_router_result(parent_index, param));
}
return(DTree());
return(DValue());
}
RENDER(Request& context)
{
app_init(context);
DTree resolved = starter_router_resolve(context);
DValue resolved = starter_router_resolve(context);
ob_start();
if(resolved["file"].to_string() != "")
@@ -52,7 +52,7 @@ RENDER(Request& context)
}
else
{
DTree notfound_props;
DValue notfound_props;
notfound_props["message"] = "The requested page does not exist.";
print(component("components/basic/notfound", notfound_props, context));
}