Chapters
20 Chapters
|
1:53:05
|
Login to bookmark this video
-
Course Code
Login or register to download the code!
Login or register to download the code!
-
This Video
Login or register to download the video!
Login or register to download the video!
-
Subtitles
Login or register to download the subtitles!
Login or register to download the subtitles!
-
Course Script
Login or register to download the script!
Login or register 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!
This tutorial works perfectly with both Symfony 7 & 8!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"php-cs-fixer/shim": "^3.46", // v3.46.0
"phpdocumentor/reflection-docblock": "^5.3", // 5.3.0
"phpstan/phpdoc-parser": "^1.25", // 1.25.0
"symfony/asset": "7.0.*", // v7.0.3
"symfony/asset-mapper": "7.0.*", // v7.0.2
"symfony/console": "7.0.*", // v7.0.2
"symfony/dotenv": "7.0.*", // v7.0.2
"symfony/flex": "^2", // v2.4.3
"symfony/framework-bundle": "7.0.*", // v7.0.2
"symfony/monolog-bundle": "^3.0", // v3.10.0
"symfony/property-access": "7.0.*", // v7.0.0
"symfony/property-info": "7.0.*", // v7.0.0
"symfony/runtime": "7.0.*", // v7.0.0
"symfony/serializer": "7.0.*", // v7.0.2
"symfony/stimulus-bundle": "^2.13", // v2.13.3
"symfony/twig-bundle": "7.0.*", // v7.0.0
"symfony/ux-turbo": "^2.13", // v2.13.2
"symfony/yaml": "7.0.*", // v7.0.0
"symfonycasts/tailwind-bundle": "^0.7.1", // v0.7.1
"twig/extra-bundle": "^2.12|^3.0", // v3.8.0
"twig/twig": "^2.12|^3.0" // v3.8.0
},
"require-dev": {
"symfony/debug-bundle": "7.0.*", // v7.0.0
"symfony/maker-bundle": "^1.52", // v1.53.0
"symfony/stopwatch": "7.0.*", // v7.0.0
"symfony/web-profiler-bundle": "7.0.*" // v7.0.2
}
}
4 Comments
I miss info how symfony knows how to find controllers. It would be somewhere in the YAML files.
Hey Leed,
Yeah, you're right, take a look at the
config/routes/routes.yamlfile - that's the config responsible for registering your routes in the controllers looking at special#[Route()]PHP attributes.Cheers!
Having a problem with PhpStorm or possibly "symfony new" the #[Route] doesn't autofill or declare in PhpStorm unless the --webapp option is added to "symfony new" is that normal? Or am I missing something!!
Hey JD,
Hm, that's weird, because both ways install
symfony/routingpackage out of the box, and that's the one where the#Routeclass comes from, see https://github.com/symfony/routing/blob/256122142e9871ce0645ee26226fa939c07cf2d4/Attribute/Route.phpSo in theory it should work. It might be a filesystem issue maybe, especially if you're using a virtualization tool like Docker when system may notice the file with some delays. I would recommend you to reload the PhpStorm, and make sure Symfony plugin activated to the project.
Or it really may be an issue with PhpStorm (or maybe a Symfony plugin), it may just not autocomplete because of a missing package that is available with --webapp, but you probably can track that down by installing more deps from the --webapp unless it will start working.
I hope that helps!
Cheers!
"Houston: no signs of life"
Start the conversation!