-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Updated routing articles to Symfony 4 #8657
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
What about promoting the controller:
key config in YAML format?
@yceruto that makes a lot of sense to me! Updated. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks!
use Symfony\Component\Routing\RouteCollection; | ||
use Symfony\Component\Routing\Route; | ||
|
||
$collection = new RouteCollection(); | ||
$collection->add('contact', new Route( | ||
'/contact', array( | ||
'_controller' => 'AcmeDemoBundle:Main:contact', | ||
'_controller' => 'App\Controller\DefaultController::contact', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's minor, and not worth delaying things because it's such a not important format, but in PHP, using the [DefaultController::class, 'contact']
is friendlier.
Brilliant! That new controller: key is great! |
This fixes #8656.