Re: Is it possible to make an argument in a method controller to be optional?

falmp | 3 years ago | parent

I have managed to do the optional arguments by looking closely to the routes tutorial. :)

My question below is still up though. Would it be possible to define a wildcard on the routes and then manage the following parameters using the Request resourceParts? Example:

!Route GET, /list/*

It seems the only available option is using the good old query strings.



KrisJordan | 3 years ago

Great suggestion. I've come across one point where it would have been nice to be able to 'consume' the rest of a URL to a variable.

I agree this is interesting behavior. Not sure what the best syntax will be. We'll want to pass the remainder of the URL matched to the controller method.

Shouldn't complicate the routing mechanisms too much.

reply

Thomas | 3 years ago

Perhaps specifying a variable to be an array, and then the rest of the URL is split in chunks and put in that array. That could be a handy feature.

reply



Welcome KrisJordan!

Web: http://www.krisjordan.com/

Location: North Carolina

Edit Profile