Appifio Creator · Lesson EM07 · Easy · 12 offline helpers

Synchronous helpers
full methods - params · returns · notes

No await needed. Same family as Aura (AM08) - Easy adds a few filename/UI helpers.

appifio_generateSlug(text)

Job: Turn a title into a URL string (supports Vietnamese).

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

Returns: slug string. Use before addRoute.

appifio_formatDateTime(serverDatetime, format?)

format param: default 'datetime'. Presets: date | time | datetime | full | iso | us | eu - or a custom pattern.

appifio_client.appifio_formatDateTime('2025-12-27 15:59:10', 'date');
appifio_client.appifio_formatDateTime(post.created_at, 'd/m/Y H:i');

Returns: formatted string. Input: SQL UTC, ISO, or 13-digit timestamp. If the page has CMS format settings → date/time/datetime presets follow that config.

appifio_formatFileSize(bytes, decimals?)
appifio_client.appifio_formatFileSize(1536000); // "1.5 MB"

Returns: human-readable size string.

appifio_getRouteSlug()
const slug = appifio_client.appifio_getRouteSlug();
// URL .../app-link/article-about-ai → "article-about-ai"

Returns: string (may be empty on the home page).

appifio_getQueryParams()
const q = appifio_client.appifio_getQueryParams();
// ?id=1&page=2 → { id: "1", page: "2" }
appifio_sanitizeFilename · getFileExtension · isImageFile · generateUniqueFilename
appifio_client.appifio_sanitizeFilename('My Photo!!.PNG');
appifio_client.appifio_getFileExtension('a.B.JPG'); // "jpg"
appifio_client.appifio_isImageFile('x.webp');       // true
appifio_client.appifio_generateUniqueFilename('a.png', 'img_');

Returns: name/extension string or boolean. Use before upload / safe filenames.

appifio_deepClone · debounce · showError · showSuccess
const copy = appifio_client.appifio_deepClone(obj);
const run = appifio_client.appifio_debounce(() => { /* … */ }, 300);
appifio_client.appifio_showError('Error');   // calls window.showError if defined
appifio_client.appifio_showSuccess('OK');

Notes: showError/Success only display if the page defines the matching hooks.

EM07 checklist: generateSlug · formatDateTime · formatFileSize · getRouteSlug · getQueryParams · sanitizeFilename · getFileExtension · isImageFile · generateUniqueFilename · deepClone · debounce · showError/showSuccess

Next

EM08 - executeBackendFunction

Appifio Creator · User guide · EM07