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

Commit 4a15942

Browse files
committed
Updated auto routing configuration
1 parent 5e7bfc5 commit 4a15942

File tree

1 file changed

+16
-38
lines changed

1 file changed

+16
-38
lines changed

cookbook/creating_a_cms/020-auto-routing.rst

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -100,54 +100,32 @@ Create the following file in your applications configuration directory:
100100
101101
# app/config/routing_auto.yml
102102
cmf_routing_auto:
103-
auto_route_mapping:
103+
mappings:
104104
Acme\BasicCmsBundle\Document\Page:
105105
content_path:
106106
pages:
107-
provider:
108-
name: specified
109-
path: /cms/routes/page
110-
exists_action:
111-
strategy: use
112-
not_exists_action:
113-
strategy: create
107+
provider: [specified, { path: /cms/routes/page }]
108+
exists_action: use
109+
not_exists_action: create
114110
content_name:
115-
provider:
116-
name: content_method
117-
method: getTitle
118-
exists_action:
119-
strategy: auto_increment
120-
pattern: -%d
121-
not_exists_action:
122-
strategy: create
111+
provider: [content_method, { method: getTitle }]
112+
exists_action: auto_increment
113+
not_exists_action: create
123114
124115
Acme\BasicCmsBundle\Document\Post:
125116
content_path:
126117
blog_path:
127-
provider:
128-
name: specified
129-
path: /cms/routes/post
130-
exists_action:
131-
strategy: use
132-
not_exists_action:
133-
strategy: create
118+
provider: [specified, { path: /cms/routes/post }]
119+
exists_action: use
120+
not_exists_action: create
134121
date:
135-
provider:
136-
name: content_datetime
137-
method: getDate
138-
exists_action:
139-
strategy: use
140-
not_exists_action:
141-
strategy: create
122+
provider: [content_datetime, { method: getDate}]
123+
exists_action: use
124+
not_exists_action: create
142125
content_name:
143-
provider:
144-
name: content_method
145-
method: getTitle
146-
exists_action:
147-
strategy: auto_increment
148-
pattern: -%d
149-
not_exists_action:
150-
strategy: create
126+
provider: [content_method, { method: getTitle }]
127+
exists_action: auto_increment
128+
not_exists_action: create
151129
152130
This will configure the routing auto system to automatically create and update
153131
route documents for both the ``Page`` and ``Post`` documents.

0 commit comments

Comments
 (0)