S
S
Sergey Zolotarev2021-12-14 16:57:24
Yii
Sergey Zolotarev, 2021-12-14 16:57:24

How to solve the problem in the work of routing, if the dynamic parameters in the URL consist of letters?

Good evening!

At the moment I'm testing the interaction of the client part with the network part on Yii2 with AJAX support for submitting an interactive form.

The network part consists of a dozen services in one action of a separate controller, and each service has its own unique URL, the parameters of which I implemented in the site config:

'api/<svc:\w+>/<subSVC:\w+>' => 'site/adminService'


\w+ are string options


When, in accordance with the controller algorithm and the logic of the service, I entered access parameters with a POST request to one of the services in the client part, which I first wanted to test not only on the local server (Example: api/dataServices/filters) and the DevTools of the browser brought bad news about that supposedly there is no such service:

app.js:138 POST http://localhost/api/dataServices/filters 404 (Not Found)


What mistakes did I make in the problematic line of the site config and how to correctly configure routing if the dynamic address parameters consist only of letters of different cases?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question