Hi there I'm trying to set up different routes with different parameters to different actions of the same controler.
The reason I#m trying this, is to achive a restfull api.
Here is my routes.yml, that doesn't seem to work:
'' : 'AppController'
'app//$Action/$ID/$OtherID' : 'AppController'
'api/mainsymptoms//$Short' : 'ApiController'
'api//$Action/$ID/$OtherID' : 'ApiController'
Normaly with the two api routes, I expect, to have one route for the mainsymptoms Actions with param('Short') and the standard fallsbacl to all other actions, but that doesn't seem to work.
So the question is, if and how I can achieve, to have different Parameters for different Actions of the same controller?
Ok... I guess if 'mainsymptoms' is not an actual page, the example won't work because it is fixed and there is no matching Action parameter in the rule.
Obviously I could be all wrong, but I'm guessing your reason for this construction is so that in the mainsymptoms() funtion you can use a param called 'Short' instead of 'ID', as it's nor really an ID? Technically there is nothing against using $ID and $OtherID...
You are right, technically there is nothing against $ID and $OtherID, it just seems a bit ugly and is not that nice. My Idea was more to create a restful api like I'm able to in RoR, but it seems, that currently Silverstripe doesn't support that. So I have to go with $ID and $OtherID (or whatever I will call them) throughout the whole controller.