Skip to content

Commit fcccd7a

Browse files
authored
How to use the route in xml
According to xsd "http://symfony.com/schema/routing/routing-1.0.xsd" the <controller> tag does not exist because it is an attribute. This way above is the correct way to use
1 parent 600f5ae commit fcccd7a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ like ``/blog/my-post`` or ``/blog/all-about-symfony``:
8080
xsi:schemaLocation="http://symfony.com/schema/routing
8181
http://symfony.com/schema/routing/routing-1.0.xsd">
8282
83-
<route id="blog_list" path="/blog">
84-
<controller>App\Controller\BlogController::list</controller>
83+
<route id="blog_list" controller="App\Controller\BlogController::list" path="/blog" >
84+
<!-- settings -->
8585
</route>
8686
87-
<route id="blog_show" path="/blog/{slug}">
88-
<controller>App\Controller\BlogController::show</controller>
87+
<route id="blog_show" controller="App\Controller\BlogController::show" path="/blog/{slug}">
88+
<!-- settings -->
8989
</route>
9090
</routes>
9191

0 commit comments

Comments
 (0)