Documentation
Documentation

Technical reference

Runtimes and source structure

Work with FPC + FCL-Web + HTMX or PHP + HTMX using the generated project conventions.

Supported runtimes

New projects default to FPC · fcl-web · HTMX: Object Pascal using Free Pascal's httproute and fphttpapp stack. PHP · HTMX is also selectable and marked beta. Existing Horse projects retain legacy support, but Horse is not offered as a new-project runtime.

The runtime is chosen for the project; it is not an instruction to turn ion7 itself into another framework. Runtime swapping in Settings is limited to the early stage before iteration history locks the choice.

FPC source conventions

Project structure
app.dpr                  Program entry point
src/Router.pas           Named route registration
src/Views.pas            Request handlers
src/Http.pas             Submitted-input helpers
src/Templates.pas        Page and fragment rendering
src/Static.pas           Embedded asset serving
templates/_layout.mustache
templates/home.mustache
public/app.css

Free Pascal 3.2.2 uses named procedures rather than anonymous methods. Preserve cthreads and cwstring first in the Unix uses clause of app.dpr. Keep HTML in Mustache templates and register request handlers through HTTPRouter.

Pascal · handler example
procedure HomePage(ARequest: TRequest; AResponse: TResponse);
begin
  AResponse.Content := Templates.Page('home',
    '{"title":"Hello from Object Pascal + fcl-web"}');
  AResponse.ContentType := 'text/html; charset=utf-8';
  AResponse.Code := 200;
end;

The handler example follows src/Views.pas and assumes the starter's imports. Templates.Page wraps the body in the shared layout; Templates.Render returns a fragment. Read submitted fields with Http.Field and related helpers instead of hand-decoding request bodies.

PHP source conventions

PHP projects use ordinary .php entry files and HTMX fragments. A full page uses _layout.php with page_start and page_end. Fragment endpoints return only the markup needed by the target element. Use explicit .php URLs; do not assume custom path rewriting is configured.

PHP · page example
<?php
require_once __DIR__ . '/_layout.php';
page_start('Notes');
?>
<main><h1>Notes</h1></main>
<?php page_end(); ?>

PHP deployment serves project files with FrankenPHP. There is no JavaScript package-build pipeline implied by this runtime, and its compile preparation step is not a comprehensive PHP syntax or behavior test.

Templates, assets, and HTMX

Keep page structure in templates or PHP views, styling in CSS, and browser-only behavior in browser scripts. HTMX requests server-rendered fragments so common interactions do not require a client-side single-page framework.

For FPC, text assets under public/ are embedded during compilation. public/app.css is served at /app.css; nested paths retain their relative structure. Generated binary images are delivered separately through the project's asset map. Do not rely on runtime disk writes for persistence.