@@ -8,10 +8,6 @@ RoutingAutoBundle
8
8
The RoutingAutoBundle allows you to automatically persist routes when
9
9
documents are persisted based on URI schemas and contextual information.
10
10
11
- This implies a separation of the ``Route `` and ``Content `` documents. If your
12
- needs are simple this bundle may not be for you and you should have a look at
13
- :doc: `the SimpleCmsBundle <../simple_cms/introduction >`.
14
-
15
11
Installation
16
12
------------
17
13
@@ -44,20 +40,22 @@ Features
44
40
--------
45
41
46
42
Imagine you are going to create a forum application that has two routeable
47
- content documents - a category and the topics. These documents are called
48
- ``Category `` and ``Topic ``, and they are called *content documents *.
49
-
50
- If you create a new category with the title "My New Category", the
51
- RoutingAutoBundle will automatically create the route
52
- ``/forum/my-new-cateogry ``. For each new ``Topic `` it could create a route
53
- like ``/forum/my-new-category/my-new-topic ``. This URI resolves to a special
54
- type of route that is called an *auto route *.
55
-
56
- By default, when you update a content document that has an auto route, the
57
- corresponding auto route will also be updated. When deleting a content
58
- document, the corresponding auto route will also be deleted.
59
-
60
- If required, the bundle can also be configured to do extra stuff, like, for
43
+ content documents - the categories and the topics. They are defined in the
44
+ document classes ``Category `` and ``Topic ``. In general, we speak of them as
45
+ *content documents *.
46
+
47
+ With the proper setup, routing auto automatically creates the route
48
+ ``/forum/my-new-cateogry `` when you create a new category with the title
49
+ "My New Category". For each new ``Topic ``, it creates a route like
50
+ ``/forum/my-new-category/my-new-topic ``.
51
+
52
+ The routes created by this bundle are documents of a special class
53
+ ``AutoRoute `` so that they can be recognized by the application as having been
54
+ autocreated. By default, when you update a content document that has an auto
55
+ route, the corresponding auto route will also be updated. When deleting such a
56
+ content document, the corresponding auto route will also be deleted.
57
+
58
+ If required, the bundle can also be configured to do extra things, like, for
61
59
example, leaving a ``RedirectRoute `` when the location of a content document
62
60
changes or automatically displaying an index page when an unconfigured
63
61
intermediate path is accessed (for example, listing all the children when requesting
89
87
-----
90
88
91
89
Imagine you have a fictional forum application and that you want to access the
92
- forum topic with the following fictional URI:
90
+ forum topic with the following URI:
93
91
94
92
- ``https://mywebsite.com/my-forum/drinks/coffee ``
95
93
@@ -168,8 +166,8 @@ follows::
168
166
}
169
167
}
170
168
171
- After persisting this object, the route will be created. You will of course
172
- be wanting to return property values and not static strings, but you get the
169
+ After persisting this object, the route will be created. Your classes will of
170
+ course be returning property values and not static strings, but you get the
173
171
idea.
174
172
175
173
.. note ::
@@ -178,7 +176,8 @@ idea.
178
176
object. Imagine you have 2 documents, ``ContactPage `` and ``Page ``, which
179
177
both extend ``AbstractPage ``. When you map the ``AbstractPage `` class, it
180
178
will be applied to both documents. You can also use the ``extend `` keyword
181
- to achieve the same thing with objects which are not related.
179
+ in the auto routing configuration file to achieve the same thing with
180
+ objects which are not related.
182
181
183
182
This is just a basic example. You can also configure what should happen when
184
183
a route already exists (conflict resolution) and what to do with old routes
0 commit comments