Getting a REST-ful URI in Joomla?

Using my own Joomla 1.5 component, module or plugin, how would I include a request for a REST URL, for example foo.com/api/..., in the corresponding echo () s on the page? I am looking for, if possible, an example of "hello world."

For example, it foo.com/api/baskets/10/fruits/list.jsonmay result in something like the following text on the page:

-- resource: baskets [id: 10]
-- resource: fruits [id: -]
-- action: list
-- format: json

Is it possible?

+3
source share
2 answers

It sounds like you want to read on Routing .

Without the SEF options, you would just link to something like the below URL, then in the controller, you would check the parameters:

index.php?option=com_example&baskets=10&action=list&formaat=json

With SEF enabled, you can control the appearance of URLs (in other words, bullets) through routing.

+1

, . JRequest, JURI JDocument RESTful .

0

Source: https://habr.com/ru/post/1718300/


All Articles