Examples
These examples include the PHP classes, templates, data setup, and mount calls needed for each interaction. Complete installation first.
| Example | Demonstrates |
|---|---|
| Article form | Entity validation and saving |
| Renderless draft saves | Save without replacing the current view |
| Search and pagination | Table finders and bounded result pages |
| Dependent fields | Server-derived choices and membership validation |
| Single document upload | File staging, validation, and private storage |
| Job polling | Pause/resume and completion controlled by PHP |
| Enhanced select | Modelable inputs, protected DOM, and PHP resets |
| Chart updates | Watching server state and updating a library instance |
Run the demo
The repository includes a separate playground with additional variations:
composer install
npm ci
npm run build
npm run previewUse PHP 8.5 with SQLite support and Node 24.11+ or Node 26+. Open http://127.0.0.1:8765. Fixtures seed automatically. The demo uses a test-only session identity; applications supply their own authentication.
Demo catalog
| Open | Try | Follow the implementation |
|---|---|---|
/renderless | Save a draft, render validation feedback, and conditionally refresh | Renderless draft saves |
/forms | Article and comment drafts with FormHelper | Article form, form binding |
/ | Search articles, edit two titles, save one, and keep the other draft | Article form, nested islands |
/ | Change country, choose a city, and confirm the selection | Dependent fields |
/playground | Adjust independent counters with typed action arguments | Actions and feedback |
/playground | Change seats and extras; reveal business fields and validate | Conditional fields |
/playground | Add, toggle, and remove tasks while other local state survives | Task board source |
/playground | Refresh the server clock; pause it or watch a simulated job complete | Polling |
/playground | Update two colored panels; recreate the one whose DOM is protected | Morph protection |
/playground | Search countries in a JavaScript widget; validate, reset, and remove it | JavaScript widgets |
/uploads | Stage documents, manage attachments, and validate before saving | File uploads |
/search | Filter 1,200 resources; sort, change page size, and paginate | Search and pagination |
/page | Update a whole-page listing while its layout stays in place | Page islands |
The /playground Failure recovery card demonstrates the failure and recovery workflow.
Playground state resets on reload. Article saves persist in the local fixture database. Search filters are reflected in the URL. The page number uses browser history; Back and Forward preserve unrelated reading notes.
Source and reset
The article form documentation imports its source from the demo in tests/test_app/. Other focused examples live in tests/docs/app/. Integration and browser tests exercise these same sources.
To reset demo data, stop the server and tests, then delete build/tmp/demo.sqlite. It is recreated on the next request. npm run preview disables OPcache so edits appear immediately. See Troubleshooting for asset or update failures and Contributing for quality checks.
Action outcomes
Save and redirect follows model validation with native navigation. Invoice download serves a file from a separate CakePHP endpoint. The larger demo combines both at /outcomes.
Lazy loading
Lazy resource count defers a finder query. Open /loading in the larger demo for all loading modes and nested preservation.
Navigation
Open /navigation in the demo for enhanced visits and a persistent notebook, including active links, scroll, and application-owned loading feedback.
Renderless draft saves
The draft editor saves through CakePHP without rebuilding the form, with validation recovery and conditional rendering. Run it at /renderless in the demo.