| Engine | Type | Best for | Key feature |
|---|---|---|---|
| Lua | Server-side | Dynamic apps, APIs, custom logic | Full Lua scripting with REST API access |
| Native | No-code | Blogs, forums, file sharing, CMS | Pre-built apps, one-click install |
| Static | Static | SPA, landing pages, git deploy | 9-layer pipeline, GitHub integration |
| ID | Name | Engine | Use |
|---|---|---|---|
| 0 | TwigHTML | Any | HTML, CSS, JS, Twig templates — general-purpose page logic |
| 29 | LuaScript | Lua only | Server-side Lua with full platform API access |
| Codes per page | 1,000 |
| Code content size | 5 MB |
| Position range | 1–1,000 (lower = runs first) |
| Permission model | Linux-style perm (0–63). Bits 0–2 = others, bits 3–5 = group. null = unrestricted. Owner + Admin always full access. |
api.dataset.find("col", filter) | → {items, total} |
api.dataset.get(id) | → table | nil |
api.dataset.create("col", data) | → table |
api.dataset.update(id, data, replace) | replace=true for full replace |
api.dataset.delete(id, permanent) | soft (default) or hard |
api.dataset.restore(id) | → table |
api.dataset.collections() | → string[] |
api.dataset.purge_collection("name") | admin only |
api.users.get(id) | → table | nil |
api.users.list(filter) | {type, level, search, page, limit} |
api.users.create(data) | → table |
api.users.update(id, data) | partial update |
api.users.login("user", "pass") | → table |
api.users.online(filter) | → items[] |
api.users.me() | currently logged-in user |
api.users.delete(id) | soft-delete (sets type=4) |
api.users.stats() | → total user count |
| api.sites | |
api.sites.get(id) · api.sites.list(page) | → table | items[] |
api.sites.current() | → {id, name, type, config} |
| api.auth | |
api.auth.session_create(sid, data) · session_check(sid) | OAuth session helpers |
| api.forums | |
api.forums.get(id) · api.forums.list(filter) | {parent, user, search, order, page, limit} |
api.forums.create("name", parentId) · rename(id,"n") · delete(id) | CRUD |
| api.posts | |
api.posts.get(id) · api.posts.list(filter) | {forum_id, user_id, status, search, order, page, limit} |
api.posts.create(data) | {forum_id, title, content, format, status} |
api.posts.update(id, data) · delete(id, hard) · restore(id) | CRUD |
api.messages.get(id) | → table | nil |
api.messages.send(to, "content") | by user ID or username |
api.messages.chat(uid, page, limit) | → messages with user |
api.messages.conversations() · api.messages.unread() | partners list · count |
api.messages.edit(id, "content") · delete(id) | CRUD |
| api.files | |
api.files.get(id) | → {url, cdn_url, thumb_url, ...} |
api.files.list(filter) | {folder_id, search, order, page, limit} |
api.files.upload(data) · import("url", folderId) | multipart · from URL |
api.files.rename(id, "n") · delete(id) | CRUD |
| api.folders | |
api.folders.get(id) · api.folders.list(parentId) | → table | items[] |
api.folders.create("n", parentId) · rename(id,"n") · delete(id) | CRUD |
| api.pages | |
api.pages.get(id) · api.pages.list(filter) | {search, order, page, limit} |
| api.codes | |
api.codes.get(id) · api.codes.list(pageId) | → table | items[] |
api.codes.create(pageId, data) | {content, type, position} |
api.codes.update(id, data) · delete(id) | CRUD |
api.codes.copy(codeId, pageId) · move(codeId, pageId) | copy to page · move to page |
api.codes.up(codeId) · api.codes.down(codeId) | move in execution order |
{{ variable }} | auto-escaped output |
{{ variable|raw }} | unescaped output (trusted content) |
{% set var = value %} | set variable |
{% if condition %} ... {% endif %} | conditional |
{% for item in items %} ... {% endfor %} | loop |
{# comment #} | comment (not rendered) |
if · elseif · else · endif · for · endfor · set · include · extends · block · endblock · macro · endmacro · import · from · spaceless · endspaceless · verbatim · endverbatim · apply · endapply · autoescape · endautoescape · flush
upper · lower · capitalize · title · trim · raw · escape · e · length · reverse · first · last · join · split · sort · date · date_modify · format · replace · number_format · abs · round · ceil · floor · json_encode · url_encode · striptags · nl2br · slice · default · keys · batch · column · filter · map · reduce · find
| Functions | |
range(low, high) · cycle(values, name) · date(format) | helpers |
max(v1, v2, ...) · min(v1, v2, ...) · random(n) | math |
attribute(obj, field) · block(name) | dynamic access |
template_from_string(str) | inline template |
| Loop Variables | |
loop.index · loop.index0 · loop.first · loop.last · loop.length | iteration info |
{% extends "layout" %} | parent template |
{% block name %} ... {% endblock %} | block override |
{% include "partial" %} | include sub-template |
{% include "partial" with {key: value} %} | include with variables |
{% macro name(params) %} ... {% endmacro %} | define reusable macro |
{% from "macros" import name %} | import macros from another template |
{{ csrf_token() }} | generate CSRF token (hidden input value) |
{{ flash("key") }} | get + consume flash message |
{% if has_flash("key") %} ... {% endif %} | check flash without consuming |