@@ -64,18 +64,21 @@ To load routes from some custom source (i.e. from something other than annotatio
6464YAML or XML files), you need to create a custom route loader. This loader
6565has to implement:class: `Symfony\\ Component\\ Config\\ Loader\\ LoaderInterface `.
6666
67+ In most cases it's better not to implement
68+ :class: `Symfony\\ Component\\ Config\\ Loader\\ LoaderInterface `
69+ yourself, but extend from:class: `Symfony\\ Component\\ Config\\ Loader\\ Loader `.
70+
6771The sample loader below supports loading routing resources with a type of
6872``extra ``. The type ``extra `` isn't important - you can just invent any resource
6973type you want. The resource name itself is not actually used in the example::
7074
7175 namespace AppBundle\Routing;
7276
73- use Symfony\Component\Config\Loader\LoaderInterface;
74- use Symfony\Component\Config\Loader\LoaderResolverInterface;
77+ use Symfony\Component\Config\Loader\Loader;
7578 use Symfony\Component\Routing\Route;
7679 use Symfony\Component\Routing\RouteCollection;
7780
78- class ExtraLoaderimplements LoaderInterface
81+ class ExtraLoaderextends Loader
7982 {
8083 private $loaded = false;
8184
@@ -110,17 +113,6 @@ type you want. The resource name itself is not actually used in the example::
110113 {
111114 return 'extra' === $type;
112115 }
113-
114- public function getResolver()
115- {
116- // needed, but can be blank, unless you want to load other resources
117- // and if you do, using the Loader base class is easier (see below)
118- }
119-
120- public function setResolver(LoaderResolverInterface $resolver)
121- {
122- // same as above
123- }
124116 }
125117
126118Make sure the controller you specify really exists. In this case you
@@ -130,6 +122,7 @@ of the ``AppBundle``::
130122 namespace AppBundle\Controller;
131123
132124 use Symfony\Component\HttpFoundation\Response;
125+ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
133126
134127 class ExtraController extends Controller
135128 {
@@ -232,11 +225,10 @@ for the ``ExtraLoader``, so it is set to ".".
232225More advanced Loaders
233226---------------------
234227
235- In most cases it's better not to implement
236- :class: `Symfony\\ Component\\ Config\\ Loader\\ LoaderInterface `
237- yourself, but extend from:class: `Symfony\\ Component\\ Config\\ Loader\\ Loader `.
238- This class knows how to use a
239- :class: `Symfony\\ Component\\ Config\\ Loader\\ LoaderResolver ` to load secondary
228+ If your custom route loader extends from
229+ :class: `Symfony\\ Component\\ Config\\ Loader\\ Loader ` as shown above, you
230+ can also make use of the provided resolver, an instance of
231+ :class: `Symfony\\ Component\\ Config\\ Loader\\ LoaderResolver `, to load secondary
240232routing resources.
241233
242234Of course you still need to implement