From the course: Symfony 6 Essential Training

Unlock the full course today

Join today to access over 25,100 courses taught by industry experts.

Stimulus

Stimulus

- [Instructor] Stimulus is a JS framework that is built for server-side rendered HTML. At first, that sounds a bit confusing. Most of what we build in Symfony is already rendered HTML. Stimulus can add the interactivity we need without having to include a heavier JS framework. Before we get to Stimulus, we need to make sure our Symfony app is set up to work with Stimulus. This requires Encore. Follow the instructions from the docs. I've already installed it in this branch. It's sort of funny to install JS with a composer require command, but Symfony handles all the logic we need. I want to point some things out. First, in assets, bootstrap.js. The bootstrap file makes sure that Stimulus is included. In assets and the controller's object, are the controllers and entry point. This will expand as I include other third-party tooling. And in webpack, on line 27 is the inclusion of that controller, json, for the build…

Contents