NAME
Uniform::HTMX::PAGI - Explicit htmx adapter connector for the PAGI ecosystem
SYNOPSIS
package MyApp::Controller::Example;
use Uniform::HTMX::PAGI;
sub update_widget ($pagi_ctx) {
# Explicit instantiation with zero auto-detection overhead
my $hx = Uniform::HTMX::PAGI->new($pagi_ctx);
if ($hx->is_htmx) {
# Chain your core operations seamlessly
$hx->res_retarget('#realtime-status')
->res_trigger('widgetRefreshed')
->apply; # Modifies response headers immediately
return $pagi_ctx->render_pagi('<p>Updated content fragment!</p>');
}
return $pagi_ctx->render_pagi('full_page');
}
DESCRIPTION
Uniform::HTMX::PAGI bridges Uniform::HTMX into native PAGI web context routines using direct object-oriented inheritance.
METHODS
new( $pagi_ctx )
Validates and instantiates the client context mapper. Requires an active PAGI application request execution context object. Automatically extracts raw headers and forwards them up to SUPER::new for full normalization tracking.
apply()
Flushes and commits your accumulated state modifications down into the target transaction. Injects compiled htmx configuration strings straight into the PAGI context response headers structure.
Returns $self to support method chaining.
SEE ALSO
AUTHOR
Joshua S. Day <HAX@cpan.org>
LICENSE
Licensed under the same terms as Uniform::HTMX.