Proposed feature

A second control in the base library of HTMX is a set of custom response headers. The available headers are:

HX-Location
allows you to do a client-side redirect that does not do a full page reload
HX-Push-Url
pushes a new url into the history stack
HX-Redirect
can be used to do a client-side redirect to a new location
HX-Refresh
if set to “true” the client-side will do a full refresh of the page
HX-Replace-Url
replaces the current URL in the location bar
HX-Reswap
allows you to specify how the response will be swapped. See hx-swap for possible values
HX-Retarget
a CSS selector that updates the target of the content update to a different element on the page
HX-Reselect
a CSS selector that allows you to choose which part of the response is used to be swapped in. Overrides an
existing hx-select on the triggering element
HX-Trigger
allows you to trigger client-side events
HX-Trigger-After-Settle
allows you to trigger client-side events after the settle step
HX-Trigger-After-Swap
allows you to trigger client-side events after the swap step

Remaining tasks

Create an HtmxHeader class that uses a Symfony HeaderBag for storage.

User interface changes

API changes

Data model changes

Issue fork htmx-3489867

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fathershawn created an issue. See original summary.

fathershawn’s picture

Issue summary: View changes
fathershawn’s picture

Status: Active » Needs review

  • fathershawn committed 91b3c4bc on 1.4.x
    Issue #3489867 by fathershawn: Support HTMX response headers
    
fathershawn’s picture

Status: Needs review » Fixed
fathershawn’s picture

Status: Fixed » Closed (fixed)