From the course: Symfony 6 Essential Training
Unlock the full course today
Join today to access over 25,100 courses taught by industry experts.
Turbo - Symfony Tutorial
From the course: Symfony 6 Essential Training
Turbo
- [Instructor] Turbo is a Symphony bundle that integrates Hotwire Turbo into your app. To understand Turbo it would be helpful to understand Hotwire first. Hotwire is an HTML over-the-wire tool, meaning write in your preferred backend language and handle server-side rendering. Hotwire will mutate the DOM accordingly. Turbo handles converting links and form submission into Ajax events, allows for decomposing pages into sections that can lazy load, and facilitates change streams. Before looking at Turbo, I want to pull up our demo app and look at the inspector. I'll load a post single to show that it's a document, and the content type is HTML. So let's add the Turbo UX component with Composer. We need to npm install, and we need to build. Now if I go back to the archive page and reload, click on our post single, you'll see that the type is still HTML, but the document is no longer the initiator. It's a fetch, and this…