Catalyst-TraitFor-Request-REST-ForBrowsers-AndPJAX
view release on metacpan or search on metacpan
# then, off in an controller somewhere...
sub action_GET_html { ... also called for PJAX requests ... }
DESCRIPTION
This is a tiny little Catalyst::Request class trait that recognizes that
a PJAX request is also a browser request, and thus looks_like_browser()
also returns true when the method is GET and the "X-Pjax" header is
present and is 'true'.
This allows actions using an action class of REST::ForBrowsers to
transparently handle PJAX requests, without requiring any more
modification to the controller or application than applying this trait
to the request class, rather than plain-old
Catalyst::TraitFor::Request::REST::ForBrowsers.
METHODS
looks_like_browser
This method is wrapped to return true if the method is GET and the
"X-Pjax" header is present and is 'true'.
Otherwise we hand things off to the original method, to render its
lib/Catalyst/TraitFor/Request/REST/ForBrowsers/AndPJAX.pm view on Meta::CPAN
sub action_GET_html { ... also called for PJAX requests ... }
=head1 DESCRIPTION
This is a tiny little L<Catalyst::Request> class trait that recognizes that a
PJAX request is also a browser request, and thus looks_like_browser() also
returns true when the method is GET and the C<X-Pjax> header is present and is
'true'.
This allows actions using an action class of REST::ForBrowsers to
transparently handle PJAX requests, without requiring any more modification to
the controller or application than applying this trait to the request class,
rather than plain-old L<Catalyst::TraitFor::Request::REST::ForBrowsers>.
=head1 METHODS
=head2 looks_like_browser
This method is wrapped to return true if the method is GET and the C<X-Pjax>
header is present and is 'true'.
( run in 0.414 second using v1.01-cache-2.11-cpan-0a6323c29d9 )