Add a router so that the following routes are supported. Users will not create a menu for com_api so the default Joomla routes will be used. If a plugin uses the id or alias parameters in querystring those can be rewritten by the route. All other query params will stay visible in the URL.
Basic route for app & resource
/components/api/:app/:resource
The URL ?option=com_api&app=<appname>&resource=<resource> will be written as the above route.
Add support for id / slug
/components/api/:app/:resource/:id or /components/api/:app/:resource/:alias
The URL ?option=com_api&app=<appname>&resource=<resource>&id=<id> will be written as the above route. In case the last segment is a non-integer it will be mapped as the alias param i.e. ?option=com_api&app=<appname>&resource=<resource>&alias=<alias>
Add a router so that the following routes are supported. Users will not create a menu for com_api so the default Joomla routes will be used. If a plugin uses the
id
oralias
parameters in querystring those can be rewritten by the route. All other query params will stay visible in the URL.Basic route for app & resource
/components/api/:app/:resource
The URL
?option=com_api&app=<appname>&resource=<resource>
will be written as the above route.Add support for id / slug
/components/api/:app/:resource/:id
or/components/api/:app/:resource/:alias
The URL
?option=com_api&app=<appname>&resource=<resource>&id=<id>
will be written as the above route. In case the last segment is a non-integer it will be mapped as the alias param i.e.?option=com_api&app=<appname>&resource=<resource>&alias=<alias>