refactor: rename DTree to DValue
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user