pp-spa
Prisma PHPControls the Single Page Application (SPA) behavior of Prisma PHP. When enabled, it intercepts standard anchor link clicks to perform seamless page transitions without a full browser reload.
How it works
The directive listens for specific event triggers on the DOM. Instead of allowing the browser to unload the current page and request a new one, Prisma PHP:
- Intercepts the click event.
-
Fetches the new content via
XHR/Fetch. -
Swaps the
<body>content intelligently. - Updates the URL history state.
Enable this once in your main layout file to turn your standard PHP app into an SPA.
<body pp-spa="true">
<!-- App Content -->
</body>
Disabling SPA (Hard Reload)
Sometimes you need a full browser refresh (e.g., logging out to clear session cookies, or linking to an external PDF/download).
You can disable the SPA behavior on a per-link basis by setting the attribute to false.
<!-- Forces a standard browser navigation -->
<a
href="/logout"
pp-spa="false"
>
Log Out
</a>