1053 Posts in 383 Topics by 376 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 500 Views |
-
SilverStripe 3.0.2-rc2 Update - Routes

13 September 2012 at 11:10am Last edited: 13 September 2012 11:11am
I have just upgraded my project to 3.0.2-rc2 and i am running into problems with the definition of a custom route.
I would like to insert a route before the modelascontrollerroutes but it always gives me either a 404 or the following error, whatever I try:
Fatal error: Based on their before & after rules two fragments both need to be before/after each other in {path}\framework\core\manifest\ConfigManifest.php on line 293
I followed the description on http://doc.silverstripe.org/framework/en/3.0/reference/director (with modifications for the changes in 3.0.2-rc2), but that doesn't work. here my code of the routes.yml file:
---
Name: shareroutes
After: '#coreroutes'
---
Director:
rules:
'': 'RootURLController'
'$URLSegment//$Action/$ID/$OtherID': 'ShortlinkController'How do I insert a custom route that should be triggered after #coreroutes and before #modelascontrollerroutes?
Thanks.
-
Re: SilverStripe 3.0.2-rc2 Update - Routes

21 September 2012 at 11:05am
After discussing with Xini on IRC, the solution is this:
share/_config/routes.yml
---
Name: modelascontrollerroutes
After: cms/routes#modelascontrollerroutes
---
Director: .....
---This issue is that, in order for every module to not explicitly have to state "After: framework, cms", the framework and cms modules have a "Before: *" statement. This makes it impossible to insert config fragments in-between fragments from cms and framework.
The work around we're using here is that framework/_config/routes.yml purposely lists only the fragment identifier in the before & after rules, not the module name. This means that by providing another fragment with the same identifier but in a different module we can insert that fragment in the same place as the original.
| 500 Views | ||
|
Page:
1
|
Go to Top |

