Skip to content

Commit 4614b4b

Browse files
committed
do not rename the template in dynamic router
$template is in line with the FrameworkBundle TemplateController
1 parent 926de06 commit 4614b4b

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Changelog
22
=========
33

4+
* **2017-02-06**: [BC BREAK] The bundle dynamic router no longer renames the `_template` parameter to `contentTemplate`.
5+
The parameter is still moved from the route defaults to the request attributes.
46
* **2017-02-03**: [BC BREAK] Removed unused `cmf_routing.dynamic.persistence.phpcr.content_basepath`
57

68
2.0.0-RC1

UPGRADE-2.0.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,37 @@
198198
</dynamic>
199199
</config>
200200
```
201+
202+
## Route Template
203+
204+
The `_template` paramter is no longer renamed to `contentTemplate`. The
205+
CmfContentBundle has been adjusted accordingly. If you have your own
206+
controllers that expect a template argument, adjust them accordingly.
207+
208+
**Before**
209+
```php
210+
$route = new Route();
211+
$route->setParent($routeRoot);
212+
```
213+
214+
**After**
215+
```php
216+
$route = new Route();
217+
$route->setParentDocument($routeRoot);
218+
```
219+
220+
## Configuration
221+
222+
* Removed the `route_basepath` setting, use `route_basepaths` instead.
223+
224+
**Before**
225+
```php
226+
public function documentAction($contentDocument, $contentTemplate) {
227+
...
228+
```
229+
230+
**After**
231+
```php
232+
public function documentAction($contentDocument, $template) {
233+
...
234+
```

src/Routing/DynamicRouter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DynamicRouter extends BaseDynamicRouter
4141
* key for the request attribute that contains the template this document
4242
* wants to use.
4343
*/
44-
const CONTENT_TEMPLATE = 'contentTemplate';
44+
const CONTENT_TEMPLATE = '_template';
4545

4646
/**
4747
* @var Request

0 commit comments

Comments
 (0)