Skip to content

Repository files navigation

webware/webware-htmx

Provides HTMX support via laminas-view to webware applications: AJAX request detection middleware, HTMX response headers and triggers, and a body-aware laminas-view renderer.

PHP Version Latest Version License Continuous Integration codecov Mutation testing badge

Installation

composer require webware/webware-htmx

Register the ConfigProvider in your Mezzio application config aggregator:

Webware\Htmx\ConfigProvider::class,

What it provides

  • DetectAjaxRequestMiddleware — detects HTMX requests and filters the incoming server request.
  • DisableBodyMiddleware — disables the body layer for HTMX requests.
  • Webware\Htmx\Response\Header — HTMX response header helpers (HX-Trigger, HX-Redirect, …).
  • Webware\Htmx\View\LaminasRenderer — a laminas-view renderer with body/layout layering, registered as the default TemplateRendererInterface.
  • A default body::default template (app-overridable).

Template override

The default body template ships at body::default. Applications override it by registering their own templates.map['body::default'] path before the package ConfigProvider in the config aggregator.

About

Provides HTMX support via laminas-view to webware applications

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages