-
-
Notifications
You must be signed in to change notification settings - Fork 5
Page logic conventions
This page captures the naming and structural rules that make page logic predictable.
Page logic filenames should map clearly to page view filenames. Function names should reflect their role:
-
gofor the normal page handler -
go_beforeandgo_afterfor the surrounding hooks -
do_*for named actions
Action names should stay explicit and readable. The function name is part of the request flow, so it should be easy to connect it back to the form or button that triggered it.
Keep page logic thin. Separate orchestration from business rules. Bind output late in the request flow once the data has been loaded and shaped.
If a page needs more local structure, the logic can optionally be wrapped in its own class, but the same underlying rules still apply: clear entry points, small handlers, and minimal hidden behaviour.
Hypermedia here simply means HTML over HTTP. When the page uses explicit actions, deliberate redirects, and clear URL-based state, the behavioural flow stays much easier to trace.
That is also why richer browser behaviour can be added later through fluid user experience without changing the core request logic into something unrecognisable.
Move on to the view and binding reference page next.
- File-based routing
- Page views
- Page logic
- Dynamic URIs
- Headers and footers
- Custom HTML components
- Page partials
- Binding data to the DOM
- DOM manipulation
- Hello You tutorial
- Todo list tutorial
- Address book tutorial WIP
- Blueprints
- Application architecture
- Coding styleguide WIP
- PHP environment setup WIP
- Web servers WIP
- Background cron tasks
- Database setup WIP
- Client-side compilation WIP
- Testing WebEngine applications WIP
- Production checklist WIP
- Security WIP