Demo route

One folder can hold a full page feature.

This route shows the default Kawhi pattern: local page.css, local page.js, route-local _partials/, a small pure logic.php, and an htmx handler in submit.php.

What to inspect

  • public/demo/index.php
  • public/demo/page.css
  • public/demo/page.js
  • public/demo/_partials/form.php
  • public/demo/submit.php
  • public/demo/logic.php

Route-local splits

Keep complexity beside the route first

If this page grows, split local markup into _partials/. Only move code to _site/ once more than one route genuinely needs it.

htmx-first

Handlers stay close to the form they serve

The form below posts to submit.php and swaps a small HTML fragment back into the page.

Interactive example

Send a demo note

Page JavaScript loaded and ready.

Awaiting submission

This panel will be replaced by a response from submit.php when the form posts via htmx.