cleanup, docs

This commit is contained in:
root
2026-06-16 12:21:31 +00:00
parent dff1959341
commit ea08d5f28b
296 changed files with 1571 additions and 1940 deletions
+2 -28
View File
@@ -37,38 +37,12 @@ For `RENDER...` and `COMPONENT...`, the unit's `ONCE(Request& context)` hook is
Example:
```cpp
// export a function
EXPORT DValue* test_func(DValue* call_param)
{
print("HELLO FROM TEST FUNCTION");
return(0);
}
// use that function in another file
unit_call("call_file_funcs.uce", "test_func");
```
Calling a named component handler through `unit_call()`:
```cpp
DValue props;
props["title"] = "Diagnostics";
props["body"] = "Ready";
unit_call("components/card.uce", "COMPONENT:BODY", &props);
```
Calling a page render handler through `unit_call()`:
```cpp
DValue props;
props["section"] = "summary";
unit_call("reports/summary.uce", "RENDER", &props);
```
Related:
- PHP: `include`, `require`, or calling a function from an included module, especially when returning arrays or objects instead of rendering a view
- JavaScript / Node.js: importing a module and calling an exported function, or dynamically loading a module and passing structured arguments
:example
print("unit_call example\n");