{"action":"created","issue":{"url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/367","labels_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/367/comments","events_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/367/events","html_url":"https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues/367","id":98123033,"number":367,"title":"[DX] Renaming Route Annotation to Controller","user":{"login":"iltar","id":1754678,"avatar_url":"https://avatars.githubusercontent.com/u/1754678?v=3","gravatar_id":"","url":"https://api.github.com/users/iltar","html_url":"https://github.com/iltar","followers_url":"https://api.github.com/users/iltar/followers","following_url":"https://api.github.com/users/iltar/following{/other_user}","gists_url":"https://api.github.com/users/iltar/gists{/gist_id}","starred_url":"https://api.github.com/users/iltar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iltar/subscriptions","organizations_url":"https://api.github.com/users/iltar/orgs","repos_url":"https://api.github.com/users/iltar/repos","events_url":"https://api.github.com/users/iltar/events{/privacy}","received_events_url":"https://api.github.com/users/iltar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-30T09:29:37Z","updated_at":"2015-07-30T10:31:26Z","closed_at":null,"body":"I'm still trying to find a solution for the miss-usage of `@Route` on the controller level. In my opinion it shouldn't be an `@Route` Annotation but something else as it's confusing. What about renaming it to `@Controller`?\r\n\r\n_Old situation_\r\n```php\r\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Route;\r\n\r\n/**\r\n * @Route(service=\"app.controller.some-controller\")\r\n */\r\nclass SomeController\r\n{\r\n    /**\r\n     * @Route(\"/some-route/\", name=\"app.some-route\")\r\n     */\r\n    public function firstLoginAction(ClientInterface $client)\r\n    {}\r\n}\r\n```\r\n_New situation_\r\n```php\r\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Controller;\r\nuse Symfony\\Component\\Routing\\Annotation\\Route;\r\n\r\n/**\r\n * @Controller(\"app.controller.some-controller\")\r\n */\r\nclass SomeController\r\n{\r\n    /**\r\n     * @Route(\"/some-route/\", name=\"app.some-route\")\r\n     */\r\n    public function firstLoginAction(ClientInterface $client)\r\n    {}\r\n}\r\n```\r\n\r\nIn case you do want to provide a prefix for your controller routes:\r\n```php\r\n/**\r\n * @Controller(\"app.controller.some-controller\", prefix=\"/my-prefix\")\r\n */\r\n```\r\nIt's pretty easy to write a BC layer for this solution. If people like this solution, I can write a PR."},"comment":{"url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/comments/126268272","html_url":"https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues/367#issuecomment-126268272","issue_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/367","id":126268272,"user":{"login":"iltar","id":1754678,"avatar_url":"https://avatars.githubusercontent.com/u/1754678?v=3","gravatar_id":"","url":"https://api.github.com/users/iltar","html_url":"https://github.com/iltar","followers_url":"https://api.github.com/users/iltar/followers","following_url":"https://api.github.com/users/iltar/following{/other_user}","gists_url":"https://api.github.com/users/iltar/gists{/gist_id}","starred_url":"https://api.github.com/users/iltar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iltar/subscriptions","organizations_url":"https://api.github.com/users/iltar/orgs","repos_url":"https://api.github.com/users/iltar/repos","events_url":"https://api.github.com/users/iltar/events{/privacy}","received_events_url":"https://api.github.com/users/iltar/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T10:31:26Z","updated_at":"2015-07-30T10:31:26Z","body":"Yes, that's pretty much it. It will also make it possible to [remove this logic](https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/8cf9ba588534a3f910907c3093db1cfc9419a50f/Routing/AnnotatedRouteControllerLoader.php#L54-L56). Right now you have 2 Route annotations, of which for methods there's no difference except that it can trigger and exception if configured incorrectly. This would bring it down to 1 Route annotation and 1 Controller annotation to which you can give a prefix in your controller as done in [the yaml variant](http://symfony.com/doc/current/book/routing.html#prefixing-imported-routes). Right now that option is just the first argument. Personally I use the service option far more than the value/path option, which is also the main reason I use the `@Route` from the extra bundle instead of core."}}