Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit f5a9c60

Browse files
committed
Added TODOs
1 parent 2e23236 commit f5a9c60

File tree

1 file changed

+76
-8
lines changed

1 file changed

+76
-8
lines changed

README.md

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,85 @@
11
# [WIP] Symfony CMF Routing Auto Route Bundle [![Build Status](https://secure.travis-ci.org/symfony-cmf/RoutingAutoRouteBundle.png)](http://travis-ci.org/symfony-cmf/RoutingExtraBundle)
22

3-
This bundle automatically creates and manages routes for given persisted document classes.
3+
This bundle is a WIP to automatically creates and manages routes for configured persisted
4+
document classes.
45

5-
Use cases:
6+
## Example configuration
67

7-
* Blog posts: To be able to view a blog posts, blog posts must have a route which
8-
is appended to that of its parent, the blog.
8+
The following is the current functional test configuration:
99

10-
- When a Post is created an auto-route is automatically created.
11-
- When the Post is updated, the auto-route is updated.
12-
- When the Post is deleted, the auto-route is deleted.
10+
symfony_cmf_routing_auto_route:
1311

14-
Restrictions:
12+
auto_route_definitions:
13+
14+
##
15+
# e.g. /cms/auto-route/blog/my-blogs-title
16+
Symfony\Cmf\Bundle\RoutingAutoRouteBundle\Tests\Functional\app\Document\Blog:
17+
chain:
18+
base:
19+
path_provider:
20+
name: specified
21+
path: /cms/auto-route/blog
22+
exists_action:
23+
strategy: use
24+
not_exists_action:
25+
strategy: create
26+
blog_title:
27+
path_provider:
28+
name: from_object_method
29+
method: getTitle
30+
exists_action:
31+
strategy: auto_increment
32+
not_exists_action:
33+
strategy: create
34+
35+
##
36+
# e.g. /cms/auto-route/blog/my-blogs-title/2013-04-09/my-post-title
37+
Symfony\Cmf\Bundle\RoutingAutoRouteBundle\Tests\Functional\app\Document\Post:
38+
chain:
39+
40+
# /cms/auto-route/blog/my-blogs-title
41+
blog_path:
42+
path_provider:
43+
name: specified
44+
from_method: getBlogRoutePath
45+
exists_action:
46+
strategy: use
47+
not_exists_action:
48+
strategy: throw_exception
49+
50+
# 2013-04-09
51+
date:
52+
path_provider:
53+
name: date
54+
format: yyyy-mm-dd
55+
from_method: getPublishedAt
56+
exists_action:
57+
strategy: use
58+
not_exists_action:
59+
strategy: create
60+
61+
# my-post-title
62+
post_title:
63+
path_provider:
64+
name: slugify_object_method
65+
from_method: getTitle
66+
slugfier: symfony_cmf_routing_auto_route.default_slugifier
67+
exists_action:
68+
strategy: auto_increment
69+
pattern: -%d
70+
not_exists_action:
71+
strategy: create
72+
73+
74+
## Restrictions:
1575

1676
* Only documents stored with PHPCR-ODM are supported.
1777
* You must have the RoutingExtraBundle installed.
78+
79+
## TODO
80+
81+
There are lots of todos but these shouldn't be forgotten:
82+
83+
* Bundle is actually called RoutingAutoBundle - code currently uses RoutingAutoRouteBundle
84+
* Change the Doctrine event subscriber to an event listener.
85+

0 commit comments

Comments
 (0)