Documentation
Learn to build and extend a PhlatPage site. Page structure and routing to views, fields, and controllers.
Documentation
PhlatPage keeps its core ideas small and consistent, so once you've learned a few of them the rest follows the same patterns. These docs cover them so you can start building without guessing.
Topics
- Getting Started: install, configure, and serve your first site
- Pages: how content is stored, structured, and retrieved
- Routing: how URLs map to handlers and views
- Views: Latte templates, layout inheritance, and the render pipeline
- Latte Templates: variable assignment, field rendering, includes, filters, and template variables
- Fields: typed content fields and custom field types
- Images: resizing, cropping, presets, and responsive image helpers
- Controllers: injecting data into views at render time
- Data Objects: the
DataObject/Pagehierarchy behind field access, saving, and queries - Overrides: how site templates, routers, and controllers take priority over addon and framework defaults
- Event Hooks: observing app lifecycle events from addons
- Addons: how addons are structured, loaded, and wired into the app
- Virtual Pages: rendering pages backed by external JSON/API data
- Toolkit Reference: static utility classes to use instead of raw PHP functions
Key ideas
PhlatPage is designed around a small number of concepts that repeat everywhere:
Pages are folders. A page lives at site/pages/{slug}/. Its URL is its folder path. Content is in data.json; structural metadata is in index.json.
Views are view-scoped. A page's view property ties it to a template, a router, a controller, and a set of field type declarations: all named after the view.
Hypermedia-first. Routes return HTML, not JSON. HTMX consumes fragments at clean URLs. The URL pattern is the API.