I have a query interface that allows for say 4 possible fields to query, name, birthyear, astrological sign, and birthstate. The user can provide a value for any one of these fields. I am using AngularJS (immaterial here) and YiiFramework (material).
I have seen answers to questions similar to this, but for the most part, people end up using querystring parameters. I can account for that in my urlManager, but would prefer to do this in the 'right' RESTful way. I have seen examples showing how to do this as:
/myservice/index.php/names/jones?birthyears=&signs=leo&birthstates=maine - meaning they did not supply birthyear
My thought to do this completely with paths skipping blank values. Is this a reasonable approach:
/myservice/index.php/api/modelname/names/jones/birthyears//signs/leo/birthstates/maine
if so, then i am struggling with the urlManager pattern
array('api/find', 'pattern'=>'api/<model:\w+>/names/<names:(|\w+)>/birthyears/<birthyears:(|\d{4})>/signs/<signs:(|\w+)>/birthstates/<birthstates:(|\w+)>', 'verb'=>'GET')
when i pass the above path to this i do not get the expected resolution. I am sure there is a better way to deal with this