-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[Security] Deleting useless controller #17154
Conversation
If you merge this, I'll do the same at https://symfony.com/doc/6.0/security/login_link.html#1-configure-the-login-link-authenticator |
I feel this is unnecessarily opinionated. Creating a controller for just a route is a valid solution. Perhaps you could just add a note to say that it is not the most optimal solution. One of the outstanding strengths of Symfony is the ability to accomplish the same thing in many different ways. |
I do not really see why we should remove this example. If any dev want's to be completely consistent throughout there project, they will probably be interested in this code tab. We can however add a comment like this inside the method: // This controller will never be called. Use any of the other config formats to configure the route without the need to create an empty controller. |
@javiereguiluz Do you know why there's no "PHP" tab in the second code sample at https://symfony.com/doc/6.0/security.html#logging-out, even though it's present in the source code (line 1680)?: .. code-block:: php
// config/routes.php
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
return function (RoutingConfigurator $routes) {
$routes->add('app_logout', '/logout')
->methods(['GET'])
;
}; |
Maybe the double space is causing the issue: Line 1690 in 695332c
|
Guys, please merge #17166 first, so we can see if this works, then continue here... |
This PR was merged into the 5.4 branch. Discussion ---------- Trying to fix code sample syntax Thanks to `@alexislefebvre` at #17154 (comment) Commits ------- 7261de9 Trying to fix code sample syntax
#17166 seems to have fixed the display issue |
That's OK for me now, since |
As already pointed out by @linaori in #10423 (comment), it's quite useless to create an empty controller, just for the route. So the recommended way should be to add it in
routes.php
- as with YAML and XML... code-block:: php
(which I was just about to add) in the source, but it's not shown on the website at https://symfony.com/doc/6.0/security.html#logging-out - why is that?