-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add support for "controller" keyword for configuring routes controllers #23227
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing | ||
http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<import resource="routing.xml"> | ||
<default key="_controller">FrameworkBundle:Template:template</default> | ||
</import> | ||
</routes> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
_static: | ||
resource: routing.yml | ||
defaults: | ||
_controller: FrameworkBundle:Template:template |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing | ||
http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<import resource="routing.xml" controller="FrameworkBundle:Template:template" /> | ||
</routes> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_static: | ||
resource: routing.yml | ||
controller: FrameworkBundle:Template:template |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing | ||
http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<import resource="routing.xml" controller="FrameworkBundle:Template:template"> | ||
<default key="_controller">AppBundle:Blog:index</default> | ||
</import> | ||
</routes> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_static: | ||
resource: routing.yml | ||
controller: FrameworkBundle:Template:template | ||
defaults: | ||
_controller: AppBundle:Homepage:show |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing | ||
http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="app_blog" path="/blog" controller="AppBundle:Homepage:show"> | ||
<default key="_controller">AppBundle:Blog:index</default> | ||
</route> | ||
</routes> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
app_blog: | ||
path: /blog | ||
controller: AppBundle:Homepage:show | ||
defaults: | ||
_controller: AppBundle:Blog:index |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing | ||
http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="app_homepage" path="/" controller="AppBundle:Homepage:show" /> | ||
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. I think we should also have another imported route that does not specify the 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. And what about a case where an imported route makes use of the |
||
|
||
<route id="app_blog" path="/blog"> | ||
<default key="_controller">AppBundle:Blog:list</default> | ||
</route> | ||
|
||
<route id="app_logout" path="/logout" /> | ||
</routes> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
app_homepage: | ||
path: / | ||
controller: AppBundle:Homepage:show | ||
|
||
app_blog: | ||
path: /blog | ||
defaults: | ||
_controller: AppBundle:Blog:list | ||
|
||
app_logout: | ||
path: /logout |
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.
can be written asisset($a, $b)
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.
Sadly you can't. See #22684.
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.
You're right, i've forgot about that. 👍