Symfony CRUD test with HTMX library.
This is a simple web site with 3 entities: book, genre of the book, author of the book.
I generated the 3 crud web interfaces with Symfony make bundle ('make:entity' and then 'make:crud') and then I modified the book controller and templates to use HTMX library to have a SPA behaviour: new, show and edit book in a bootstrap modal, delete book confirmation also with bootstrap modal.
The goal is to compare standard Symfony CRUD form with HTMX CRUD form. So:
- author CRUD is the symfony standard CRUD with generated plain HTML template
- genre CRUD is the symfony standard CRUD with generated plain HTML template
- book is a modified CRUD using HTMX, bootstrap library ad a very little of javascript
My goal is to show how simply is to use HTMX with Symfony standard backend ;-)
$ git clone ...
and then copy .env to .env.local and set your database; by default .env use sqlite.
Make sure you have PHP 8.1, 'composer', 'yarn' and 'symfony' command installed.
$ cd web/
$ composer install/update
$ yarn install
$ yarn dev
Run migrations:
$ php bin/console doctrine:migration:migrate
and start HTTP server
$ symfony server:start
go to
go to
- Symfony PHP framework
- HTMX - high power tools for HTML
- Blog Post "Modal forms with Django+HTMX" from Benoit Blanchon inspiring article and Video tutorial