NAME
Uniform::HTMX::Mojolicious - Explicit htmx adapter connector for the Mojolicious ecosystem
SYNOPSIS
package MyApp::Controller::Example;
use Mojo::Base 'Mojolicious::Controller';
use Uniform::HTMX::Mojolicious;
sub update_widget ($self) {
# Explicit instantiation with zero auto-detection overhead
my $hx = Uniform::HTMX::Mojolicious->new($self);
if ($hx->is_htmx) {
# Chain your core operations seamlessly
$hx->res_retarget('#realtime-status')
->res_trigger('widgetRefreshed')
->apply; # Modifies $self->res->headers immediately
return $self->render(text => '<p>Updated content fragment!</p>');
}
return $self->render(template => 'full_page');
}
DESCRIPTION
Uniform::HTMX::Mojolicious provides an explicit integration binding bridge that enables the Uniform::HTMX specification layer to interact natively inside Mojolicious::Controller routing loops.
METHODS
new( $c )
Validates and instantiates the client context mapper. Requires a valid, active Mojolicious::Controller reference. Automatically normalizes inbound request headers via the core parent class utilities.
apply()
Flushes and commits your accumulated state modifications down into the target transaction. Injects compiled htmx configuration strings directly onto the outbound response header stack.
Returns $self to support method chaining.
SEE ALSO
AUTHOR
Joshua S. Day <HAX@cpan.org>
LICENSE
Licensed under the same terms as Uniform::HTMX.