Chapters
32 Chapters
|
4:16:27
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"babdev/pagerfanta-bundle": "4.x-dev", // 4.x-dev
"doctrine/doctrine-bundle": "^2.10", // 2.12.x-dev
"doctrine/doctrine-migrations-bundle": "^3.2", // 3.4.x-dev
"doctrine/orm": "^2.16", // 2.18.x-dev
"knplabs/knp-time-bundle": "dev-main", // dev-main
"pagerfanta/doctrine-orm-adapter": "4.x-dev", // 4.x-dev
"pagerfanta/twig": "4.x-dev", // 4.x-dev
"symfony/asset": "6.4.*", // 6.4.x-dev
"symfony/asset-mapper": "6.4.*", // 6.4.x-dev
"symfony/console": "6.4.x-dev", // 6.4.x-dev
"symfony/dotenv": "6.4.x-dev", // 6.4.x-dev
"symfony/flex": "^2", // 2.x-dev
"symfony/form": "6.4.x-dev", // 6.4.x-dev
"symfony/framework-bundle": "6.4.x-dev", // 6.4.x-dev
"symfony/monolog-bundle": "^3.0", // dev-master
"symfony/runtime": "6.4.x-dev", // 6.4.x-dev
"symfony/security-csrf": "6.4.x-dev", // 6.4.x-dev
"symfony/stimulus-bundle": "2.x-dev", // 2.x-dev
"symfony/twig-bundle": "6.4.x-dev", // 6.4.x-dev
"symfony/ux-autocomplete": "2.x-dev", // 2.x-dev
"symfony/ux-live-component": "2.x-dev", // 2.x-dev
"symfony/ux-turbo": "2.x-dev", // 2.x-dev
"symfony/ux-twig-component": "2.x-dev", // 2.x-dev
"symfony/validator": "6.4.x-dev", // 6.4.x-dev
"symfony/web-link": "6.4.*", // 6.4.x-dev
"symfony/yaml": "6.4.x-dev", // 6.4.x-dev
"symfonycasts/dynamic-forms": "dev-main", // dev-main
"symfonycasts/tailwind-bundle": "dev-main", // dev-main
"tales-from-a-dev/flowbite-bundle": "dev-main", // dev-main
"twig/extra-bundle": "^2.12|^3.0", // 3.x-dev
"twig/twig": "^2.12|^3.0" // 3.x-dev
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4", // 3.6.x-dev
"phpunit/phpunit": "^9.5", // 9.6.x-dev
"symfony/browser-kit": "6.4.*", // 6.4.x-dev
"symfony/css-selector": "6.4.*", // 6.4.x-dev
"symfony/debug-bundle": "6.4.x-dev", // 6.4.x-dev
"symfony/maker-bundle": "^1.51", // dev-main
"symfony/panther": "^2.1", // v2.1.1
"symfony/phpunit-bridge": "7.1.x-dev", // 7.1.x-dev
"symfony/stopwatch": "6.4.x-dev", // 6.4.x-dev
"symfony/web-profiler-bundle": "6.4.x-dev", // 6.4.x-dev
"zenstruck/browser": "1.x-dev", // 1.x-dev
"zenstruck/foundry": "^1.36" // 1.x-dev
}
}
What JavaScript libraries does this tutorial use?
// importmap.php
return [
'app' => [
'path' => './assets/app.js',
'entrypoint' => true,
],
'js-confetti' => [
'version' => '0.11.0',
],
'@hotwired/stimulus' => [
'version' => '3.2.2',
],
'@symfony/stimulus-bundle' => [
'path' => './vendor/symfony/stimulus-bundle/assets/dist/loader.js',
],
'tom-select' => [
'version' => '2.3.1',
],
'tom-select/dist/css/tom-select.default.css' => [
'version' => '2.3.1',
'type' => 'css',
],
'@hotwired/turbo' => [
'version' => '7.3.0',
],
'stimulus-popover' => [
'version' => '6.2.0',
],
'debounce' => [
'version' => '1.2.1',
],
'turbo-view-transitions' => [
'version' => '0.3.0',
],
'stimulus-use' => [
'version' => '0.52.1',
],
'flowbite' => [
'version' => '2.2.1',
],
'@popperjs/core' => [
'version' => '2.11.8',
],
'flowbite-datepicker' => [
'version' => '1.2.6',
],
];
13 Comments
Little typo, id="planet-info">
Got it! thanks! https://github.com/SymfonyCasts/30-days-last/commit/1d963c2a8dc16ea7aaa25da063724c680e07a1b1
How do I share the state of the page where clicked planet links gets planet content into left div? I don't see that url has been changed.
Hey @Filip!
If you need this, then you need the URL to change. We show how to do that here - https://symfonycasts.com/screencast/last-stack/data-tables#advancing-the-frame
In this case, the only weird thing would be that the URL would change to something like
/planets/5... and when you refresh, instead of seeing the homepage with a planet sidebar, you'd see the planet show page. So, if I had this requirement in this situation, I'd probably make my homepage able to have a planet id in it - e.g./?planet=5or/{planet}if you want. Then, I'd make my links on the sidebar go to this URL. And in the homepage template, I'd render a specific planet if the planet is in the URL. Then allowing the URL to change to/?planet=5would work perfectly when you refresh.Cheers!
The links remain hidden for me when the content is loaded in the turbo frame using src despite using turbo-frame:block in the class for the div.
I've added the plugin in the tailwind.config.js as directed.
I've managed to get it working now. I must admit that I took a break from this incredibly fantastic course during the holidays, and only today have I resumed it so it might have been something that stopped working due to that. I've tried
asset-map:compile+tailwind:build -wand a good refresh of the page and it did the trick.Thank you, I met the same issue too.
Hey @apphancer!
Ah, happy it's working now! The ol' "unplug it and plug it back in" fix 😆. And really happy you're enjoying the tutorial - I had a blast making it.
Cheers!
I'm using Turbo frames, and I get weird behavior with the back button on the browser. I use turbo-advance to change the URL, and that works well enough, but when I go back, the navbar that isn't in the main frame stops working. Side note, I'm using Tailwind Nav drop down, and I was struggling to get it to close on a turbo visit, so I wrote a controller to simulate a 'click outside event', which works,well, but even if I don't use that controller, Turbo doesn't behave right with my navbar. I'd really like the back and forward buttons on the browser to work, but I also really like Turbo Frames, can I have both?
Hey @Brandon!
Hmm. Short answer: you can disable the turbo page cache. It's not a super important part of Turbo and it tends to be the toughest part to get right.
Long answer: you said you're using
Tailwind Nav drop? What is that exactly - is it from Flowbite? What is the JavaScript that powers it? Basically, my guess is that the JavaScript isn't written in a way where it doesn't like being removed from the page then re-added (this is what happens when you hit Back: Turbo originally took a snapshot of the previous page when you first navigated off of it, then when you hit Back, it put that snapshotted HTML back). This is why having the JS in Stimulus is important. But, it is super frustrating that libraries (e.g. Bootstrap's js or Flowbite) are written in a way where they don't work without full page reloads (though Flowbite DOES have a Turbo-specific file... which I haven't tried, but should work - https://cdn.jsdelivr.net/npm/flowbite@2.2.1/dist/flowbite.turbo.js/ esmOh, and btw - this isn't an issue of Turbo frames, but of what happens when Turbo navigates in general - either via a Turbo frame with
action="advance"or with a normal Turbo Drive navigation.Let me know if this helps!
Cheers!
I must be very super old because I remember the frames (framesets) that came before iframes. Dang!
Oh yea, framesets! I remember those too. But I don't remember (at least not anymore) frames before iframes. So iframes were the "new fancy thing at some point?). Lol
Hey Julien,
Dang! 😅 Well, you know the whole history from the very beginning then I suppose, good enough to see the evolution of it 🙃
Cheers!
"Houston: no signs of life"
Start the conversation!