Alpha ZealPHP is early-stage and under active development. APIs may change between minor versions until v1.0. Feedback and bug reports welcome on GitHub.
API Index — Namespaces, Packages, Reports, Indices

DemoHelpers
in package

Shared helpers for the ZealPHP OSS website's live-demo routes.

Extracted verbatim from route/demo.php so the route file stays function-free (top-level functions in a route file fatal "Cannot redeclare" when App::reloadRoutes() re-includes it). These are pure presentation helpers: timing utilities and the demo-viewer shell renderer.

Table of Contents

Methods

_demo_phrase()  : string
demo_ms()  : float
demo_render()  : string
Render a demo viewer page through a clean standalone shell — site CSS (zealphp.css + learn.css) for typography and colors, but no big top-nav or footer. The whole shell + breadcrumb + body lives in template/components/_demo_shell.php.
demo_section_response()  : array{heading: string, body: string}
Renders one "Response" section showing status + content-type + payload.
demo_t()  : float

Methods

_demo_phrase()

public static _demo_phrase(int $s) : string
Parameters
$s : int
Return values
string

demo_ms()

public static demo_ms(float $start) : float
Parameters
$start : float
Return values
float

demo_render()

Render a demo viewer page through a clean standalone shell — site CSS (zealphp.css + learn.css) for typography and colors, but no big top-nav or footer. The whole shell + breadcrumb + body lives in template/components/_demo_shell.php.

public static demo_render(string $title, string $description, array<int, array{heading: string, body: string}> $sections, string $back_slug, string $back_label) : string
Parameters
$title : string
$description : string
$sections : array<int, array{heading: string, body: string}>
$back_slug : string
$back_label : string
Return values
string

demo_section_response()

Renders one "Response" section showing status + content-type + payload.

public static demo_section_response(int $status, string $contentType, string $payload[, bool $pretty = true ]) : array{heading: string, body: string}
Parameters
$status : int
$contentType : string
$payload : string
$pretty : bool = true
Return values
array{heading: string, body: string}

demo_t()

public static demo_t() : float
Return values
float
On this page