Code sample using generateSlug and formatDateTime sync helpers
Sync helpers

Appifio Creator · Lesson AM08 · API REFERENCE §7 · 5 helpers

Synchronous helpers
no network - full structure

Five functions that run immediately in the browser - no await. Use them for dates, slugs, and reading the URL.

appifio_generateSlug(text)

What it does: Turn a title into a URL-friendly string (including Vietnamese support).

const slug = appifio_client.appifio_generateSlug('An article about AI');
// → "an-article-about-ai"

Returns: slug string. Often used before addRoute / appendData.

appifio_formatDateTime(isoOrSql, format?) · Date/time formatting section

What it does: Display date/time from server data - via CMS settings or presets. Do not hand-roll toLocaleDateString / timezone math.

Inputs the server understands:

  • YYYY-MM-DD HH:mm:ss (no offset) → treated as UTC, then converted to the display timezone
  • ISO with Z or +07:00
  • 13-digit timestamp (ms)

format parameter: omit ≈ preset 'datetime'. Presets: 'date' | 'time' | 'datetime' | 'full' | 'iso' | 'us' | 'eu' - or a custom pattern ('d/m/Y H:i', 'j F Y'…).

With Aura CMS (Panel → Settings → Date/time formats): presets date/time/datetime follow site config (IANA timezone, or empty = visitor browser). Typical CMS defaults: date j F Y (e.g. 4 Jul 2026), time H:i.

Without CMS - preset examples:

PresetExample
datetime (default)04 Jul 2026 15:30
date04 Jul 2026
time15:30:00
eu / us / iso / fullEU / US / ISO / full styles
appifio_client.appifio_formatDateTime(post.created_at);
appifio_client.appifio_formatDateTime(post.created_at, 'date');
appifio_client.appifio_formatDateTime(post.created_at, 'd/m/Y H:i');

Returns: formatted string. Every created_at / published_at should go through this before display. Pattern tokens: d j m n Y y F M · H G h g i s a A (+ legacy YYYY MM DD HH mm…).

appifio_formatFileSize(bytes)
appifio_client.appifio_formatFileSize(1536000); // → "1.5 MB" (human-readable)

Parameters: byte count. Returns: size string.

appifio_getRouteSlug()

What it does: Get the slug segment after the app link name in the current URL (detail / post pages…).

const slug = appifio_client.appifio_getRouteSlug();

Returns: current slug string (may be empty depending on the URL).

appifio_getQueryParams()

What it does: Read URL query params like ?id=1&page=2.

const q = appifio_client.appifio_getQueryParams();
// q.id, q.page, ...

Returns: object of key → value pairs.

Blog list example

URL Routes table useful with getRouteSlug helper context
Routes + slug helpers
const res = await appifio_client.appifio_readList('blog.json', ['id','title','slug','created_at']);
for (const post of (res.data?.content || [])) {
  const when = appifio_client.appifio_formatDateTime(post.created_at, 'date');
  // render...
}
§7 checklist: generateSlug · formatDateTime · formatFileSize · getRouteSlug · getQueryParams = 5/5

Full AM series index = full API REFERENCE

Lesson§Method count
AM01IntroHow to call + standard response
AM021 Indexed4
AM032 Flat15
AM043 FS & upload7
AM054 Route3
AM065 Auth12
AM076 Backend1
AM087 Helper5
API REFERENCE method total47 (4+15+7+3+12+1+5)

Does not include CMS/MCP panel methods - see the AS series (UI only).

Extended index AM09-AM12 (sections outside API REFERENCE)

LessonGuide sectionContent
AM09Globals & bootstrapBootstrap, global.apps, waitForAppStorage
AM10URL · Empty · Rate limitgetAbsoluteUrl, required routes, err.blocked
AM11System files & CMSManifest, entity map, security enforce
AM12Worked examplesExamples 1-9 end-to-end

Appifio Creator · Method series · AM08