- A unified experience for web development! -
Empowering dreams, pushing boundaries, and exploring limitless possibilities.
Fresh perspectives and updates
^^ Want your name here Fork from Here or Let me know of your PHP/JS Experiments with PHPue! ^^
--- Feedback ---
mailto:feedback@phpue.co.uk
What's the trick, Edward?
In PHP, developers work directly with the browserβs native JavaScript - thereβs no Node.js runtime, no bundlers, and no build pipeline by default.
That constraint is actually a strength.
AlpineJS fits this world incredibly well! It is lightweight, browser-native, and gives developers a clean way to write PHP-driven markup with JavaScript listeners - without falling back to heavy jQuery-style writing or complex frontend tooling.
PHPue takes this a step further by allowing you to define AJAX listeners directly inside the view, without ever leaving the file. This keeps SSR and CSR in sync, dramatically improving the developer experience and restoring a sense of control and clarity.
Creating endpoints inside the view genuinely lifts the weight off your shoulders. The best part?! You can build anything from pure motivation and creativity, with or without additional PHP or JavaScript library use!
Checkout the PHPue + TailwindCSS + AlpineJS Library on GitHub!
Note: NodeJS is required to build the TailwindCSS Styles in this template: simply run npm run build to build the TailwindCSS Minimalistic file.
If you are new to PHPue, please use Native PHPue Framework and learn first with native JS, before trying Alpine.JS! - Get Started
You can build PHP submit forms and just point to your designated view, '/submit' or your designated PHP submission file, '/components/form/submit.php'. No framework lock in.
If you become stuck, use backend/ for scripts that boots up / registers at request, or use components/ creating a components/submit.php file, or use PHPue's native view system, 'views/' creating a views/submit.pvue view, adding your PHP logic to the <script> block.
Otherwise, you want to use JS communication to submit a form?! Just create a @AJAX('POST') with a $input body parameter or @AJAX('GET') with $_GET('') PHP variable. Calling the endpoint with fetch('', ...) (no need to enter a route, PHPue sets all endpoints at entry). This way you can manipulate the form on the Client-side, and have full control of submission data on the Server-side!
I personally try to stay away from framework wars! PHPue, tries to bridge the gap between PHP and JS, whilst simply providing a better developer experience, and lightweight framework/template engine without complexity!
It doesnβt dilute PHP or JavaScript β it reinforces each language where it performs best.
PHPue is a framework that dissolves on compile, leaving beautiful .php files. If you lose the source files, you can still edit the PHP files, and still make workable applications! Though, we do recommend backing up your IP, of course!
Check out our Latest Campaign:
Are you a JavaScript developer?
Test which JavaScript libraries work well with PHPue β and why they do.
For example, does HTMX + PHPue make sense for SPA-style flows? Try it and share your findings.
Are you a PHP developer?
Youβve got options.
Is the framework missing something you need? Fork it and add the feature.
Want to experiment instead? Try different PHP / Composer libraries inside backend/ and see which ones PHPue does (or doesnβt) support cleanly.
Interested in routing? You could be the first to add more complex patterns like [:id].pvue or /user/login.
(I personally prefer /user?login using native PHP $_GET, but PHPue could benefit from all approaches.)
Also, you could create a backend/ library to enable new functionality without modifying the framework directly β just something to keep in mind.
Just remember β try to KISS.
Ready to build? Skip the configuration headache and check out our step-by-step AlpineJS Foundations Tutorial to see exactly how to implement live counters, reactive forms, and components natively in PHPue.