-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Create new shortcut methods in the Controller\Controller #11166
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
Comments
+1 Who cares about coupling should use controllers as services in the first place. Symfony's default |
Maybe a |
@bezhermoso |
@merk Oh, cool! :) Disregard my suggestion then. Haha, I feel stupid for not realizing that XD |
👍 |
… and isGranted() shortcut methods to Controller
Hi there |
@lukaswoj Probably not. There is a |
I feel like the commit proposed by @lukaswoj has some wrong things in it and this is also the first time I would like to help on the core so I don't know. Is it better to wait for him to change his work according to the comments or propose my own solution ? Also, I think we should also add |
@Cydonia7 if your proposal is quite different, then you should submit your own. If you think their pull request can be fixed, then you should comment on it. |
Sorry guys for abandoning this like that. |
Here is my try to add these methods : https://github.com/Cydonia7/symfony/commit/73d8f327dd0ef7c0513966ed579094a013ea82f8 I think it is good enough to create a PR, what do you think ? |
@Cydonia7 It's certainly a fine good start. Go ahead and create a PR - we can have some more discussion there. Thanks for taking that on! |
…(Cydonia7) This PR was merged into the 2.6-dev branch. Discussion ---------- [FrameworkBundle] Add shortcut methods to controllers | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #11166 | License | MIT | Doc PR | symfony/symfony-docs#4109 To-do list : - [x] submit changes to the documentation Added redirectToRoute, addFlash, isGranted and checkGranted to controllers. The code seems so simple I didn't feel like adding controller tests was needed since we're just shortcuting other services calls. Commits ------- 74d8c9a Add redirectToRoute, addFlash, isGranted and denyAccessUnlessGranted shortcuts to controllers.
Following the new DX initiative, I want to propose to add some new shortcut methods to the
Symfony\Bundle\FrameworkBundle\Controller\Controller
.I like a lot the shortcuts created in the KnpRadBundle; so my proposal is to implement:
The text was updated successfully, but these errors were encountered: