Installs phtmx into a Phoenix 1.8+ application.
mix igniter.install phtmxIt performs four edits, each idempotent and each degrading to a printed notice (rather than a guessed edit) if it can't confidently locate the anchor — you always review the full diff before anything is written:
- adds
plug Phtmx.Plugto the:browserrouter pipeline; - adds
import Phtmx.Responseto the web module'scontroller/0; - adds the CSRF
hx-headersattribute to<body>in the root layout; - vendors
htmx.min.jsintoassets/vendor/and imports it fromassets/js/app.js.
Options
--pipeline- the router pipeline to add the plug to (default:browser)--htmx-version- the htmx version to vendor (default:2.0.4)--skip-asset-fetch- don't download htmx; still wires theapp.jsimport and prints a notice so you can vendor it yourself (useful offline or in CI)