Skip to content

Commit bd6e3f3

Browse files
committed
Rewrite first paragraph
1 parent 46d10a2 commit bd6e3f3

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

cookbook/routing/custom_route_loader.rst

+15-11
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@
44
How to Create a custom Route Loader
55
===================================
66

7-
A custom route loader allows you to add routes to an application without
8-
including them, for example, in a YAML file. This comes in handy when
9-
you have a bundle but don't want to manually add the routes for the bundle
10-
to ``app/config/routing.yml``. This may be especially important when you want
11-
to make the bundle reusable, or when you have open-sourced it as this would
12-
slow down the installation process and make it error-prone.
13-
14-
Alternatively, you could also use a custom route loader when you want your
15-
routes to be automatically generated or located based on some convention or
16-
pattern. One example is the `FOSRestBundle`_ where routing is generated based
17-
on the names of the action methods in a controller.
7+
What is a Custom Route Loader
8+
-----------------------------
9+
10+
A custom route loader enables you to generate routes based on some
11+
conventions or patterns. A great example for this use-case is the
12+
`FOSRestBundle`_ where routes are generated based on the names of the
13+
action methods in a controller.
14+
15+
A custom route loader does not enable your bundle to inject routes
16+
without the need to modify the routing configuration
17+
(e.g. ``app/config/routing.yml``) manually.
18+
If your bundle provides routes, whether via a configuration file, like
19+
the `WebProfilerBundle` does, or via a custom route loader, like the
20+
`FOSRestBundle`_ does, an entry in the routing configuration is always
21+
necessary.
1822

1923
.. note::
2024

0 commit comments

Comments
 (0)