@@ -98,7 +98,7 @@ and configure the service and method to call:
98
98
99
99
# config/routes.yaml
100
100
admin_routes :
101
- resource : ' admin_route_loader:loadRoutes'
101
+ resource : ' admin_route_loader:: loadRoutes'
102
102
type : service
103
103
104
104
.. code-block :: xml
@@ -110,7 +110,7 @@ and configure the service and method to call:
110
110
xsi : schemaLocation =" http://symfony.com/schema/routing
111
111
https://symfony.com/schema/routing/routing-1.0.xsd" >
112
112
113
- <import resource =" admin_route_loader:loadRoutes" type =" service" />
113
+ <import resource =" admin_route_loader:: loadRoutes" type =" service" />
114
114
</routes >
115
115
116
116
.. code-block :: php
@@ -119,14 +119,20 @@ and configure the service and method to call:
119
119
namespace Symfony\Component\Routing\Loader\Configurator;
120
120
121
121
return function (RoutingConfigurator $routes) {
122
- $routes->import('admin_route_loader:loadRoutes', 'service');
122
+ $routes->import('admin_route_loader:: loadRoutes', 'service');
123
123
};
124
124
125
125
In this example, the routes are loaded by calling the ``loadRoutes() `` method
126
126
of the service whose ID is ``admin_route_loader ``. Your service doesn't have to
127
127
extend or implement any special class, but the called method must return a
128
128
:class: `Symfony\\ Component\\ Routing\\ RouteCollection ` object.
129
129
130
+ If you're using :ref: `autoconfigure <services-autoconfigure >`, your service should
131
+ implement the `ServiceRouterLoaderInterface ` interface to be tagged automatically by
132
+ Symfony!
133
+
134
+ If you are **not using autoconfigure **, tag it manually with ``routing.route_loader ``.
135
+
130
136
.. note ::
131
137
132
138
The routes defined using service route loaders will be automatically
0 commit comments