Skip to content
\n

I tried to clear cache and restart server, nothing worked. Finally I found somewhere (not in the book itself, and actually the problem was different): composer require annotations.

\n

This created this file: \"config/routes/annotations.yaml\" which looks like this:

\n
controllers:\n    resource: ../../src/Controller/\n    type: annotation\nkernel:\n    resource: ../../src/Kernel.php\n    type: annotation
\n

And... it worked. But why? I mean - Why did I have to do this, and what does 'annotations' from Doctrine have to do with routing in Symfony?

\n

This book was supposed to guide me step by step into the intricacies of Symfony, and yet I got stuck on such a simple step :(

\n

BTW, I know there is a book for 6.2 but I am supposed to learn 5.4. It's not that old AFAIK.

\n

I'm on the verge of madness... this is my second attempt with Symfony, and also my second with the book \"The Fast Track,\"

","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"

Have a look at https://symfony.com/doc/5.4/routing.html.
\nNote that depending on PHP7 OR PHP8 you will have a different composer/config.
\nSince PHP7 is EOL, read the attributes sections.

\n

As for Symfony project references, you can take a look at the Symfony Demo Project. It can help a lot!

\n

Check also SymfonyCast tutorials

","upvoteCount":2,"url":"https://github.com/symfony/symfony/discussions/51515#discussioncomment-6882686"}}}
Discussion options

You must be logged in to vote

Have a look at https://symfony.com/doc/5.4/routing.html.
Note that depending on PHP7 OR PHP8 you will have a different composer/config.
Since PHP7 is EOL, read the attributes sections.

As for Symfony project references, you can take a look at the Symfony Demo Project. It can help a lot!

Check also SymfonyCast tutorials

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by kpion
Comment options

You must be logged in to vote
1 reply
@cavasinf
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants