-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[WIP] Use controller autowiring / DunglasActionBundle #315
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
Changes from all commits
a9e1ebd
2dbd8ab
be48eb4
539dfd8
35f1ea2
6985cec
436265d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,6 @@ cache: | |
matrix: | ||
fast_finish: true | ||
include: | ||
- php: 5.3 | ||
- php: 5.4 | ||
- php: 5.5 | ||
- php: 5.6 | ||
- php: 7.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,8 @@ | |
"symfony/monolog-bundle" : "~2.7", | ||
"symfony/swiftmailer-bundle" : "~2.3", | ||
"symfony/symfony" : "~2.8", | ||
"twig/extensions" : "~1.2" | ||
"twig/extensions" : "~1.2", | ||
"dunglas/action-bundle" : "~1.0@dev" | ||
}, | ||
"require-dev": { | ||
"sensio/generator-bundle": "~3.0" | ||
|
@@ -52,7 +53,7 @@ | |
"config": { | ||
"bin-dir": "bin", | ||
"platform": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not good. We want to keep the demo compatible with older PHP versions, to ensure that someone running @javiereguiluz we may switch to 5.4 as min target though, as the installer itself requires 5.4 anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. I'll restore it as is when it will be ready. But this PR will require Symfony 3.1 anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, this should be changed to |
||
"php": "5.3.9" | ||
"php": "5.5.9" | ||
} | ||
}, | ||
"extra": { | ||
|
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.
This is the interesting part here.
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.
In a real application, these services would be used in other services, in console commands, etc. You cannot remove them.
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.
I agree than in a real app large app I would explicitly defined at least the
slugger
service. However, it's not necessary in this sample RAD app and it shows how the new controller system can be used (for RAD only of course).Just some hints:
@markdown
is used in@app.twig.app_extension
)AppExtension
or if you rename themarkdown
service, you don't need to update your config@markdown
is itself autowired the@markdown
is automatically injected (@app.twig.app_extension
)@slugger
definition for instance) doesn't break anything (the named service will be detected and injected everywhere the autowiring service is defined)autowired.the\fqn
name (but it's better to name them explicitly if you want to access them). Here there is a@autowired.AppBundle\Utils\Slugger
service.Btw, console commands can be autowired the same way than controller, I'm adding an example right now.