-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Can't load routing via annotations #23
Comments
The error message, while technically exact, is not the "right" one. By the ways, we have many of these issues now because we are using components individually. I've fixed some of them in 3.3, but I'm sure there are many other ones. Here, the annotation loader is not registered as you probably don't have Doctrine annotations installed. Anyway, even when doing so, you also need SensioFrameworkExtraBundle to make it work. Try To "fix" this, we should probably move the routing annotation loader definitions from the extra bundle to the core framework (possible as all classes are in the routing component). We can auto-register these loaders when annotations are available. This would still need the Doctrine annotations lib, but adding a comment in the default |
There is another issue here: as we need to set |
@fabpot once Symfony 3.3 is stable, we won't need to set min-stability to dev though |
Yes, of course, I was referring to people who will test Flex in the next few weeks. |
Closing as we improved the error message and because 3.4 will support annotations out of the box without the need to install framework-extra bundle. We also added a note in the routing file. |
@fabpot we may want to create an annotations-pack requiring both doctrine/annotations and doctrine/cache though |
@stof Done in symfony/recipes#99 |
Should annotation routes work? I just installed symfony 4.
This does not work. I think I do ok by documentation. Composer.json :
I get error:
|
@darius-v |
@chalasr - so this maybe should be in documentation? At least I cannot see: https://symfony.com/doc/current/routing.html#creating-routes |
Couldn't get 3.4 to work with annotations as I had the same problem. Thanks @chalasr. |
I created a pr to the docs to add the install line. |
Hello, I have this error:
annotations.yaml
routes.yaml
MessageController.php
But the route /message doesn't work. Another routing problem:
Note: It's a clean new Flex installation, I have followed the official doc. |
Exactly the same issue than @AxelBriche here. |
@AxelBriche, in my case I had forgotten the |
@scandel in that case you would see an Apache "404 Not Found", not a Symfony error page so I don't think that can be it in this case. edit: in case of @AxelBriche it does look like an Apache error indeed :) |
I have a same problem.
`<?php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class testController extends AbstractController {
}` /var/www/html # bin/console debug:router -vvv Name Method Scheme Host Path I am under nginx server and i have used nginx config : `server {
}` |
Folder names are capitalized make sure not to misspell them like I did in the routes and annotations definitions. |
If I uncomment this in the default
/etc/routing.yaml
:And create a
src/Controller/DefaultController.php
with the appropriate annotations, I see this error:But this should work after this change: symfony/symfony#21231
The text was updated successfully, but these errors were encountered: