D
D
ddddd tttt2019-01-02 18:58:53
Yii
ddddd tttt, 2019-01-02 18:58:53

How to specify in urlManager that the controller is in the controllers/api folder?

[
            'class' => 'yii\rest\UrlRule',
            'controller' => ['api/user'],
            'pluralize' => false,
            'extraPatterns' => [
                'GET index' => 'view',
                'PUT index' => 'update',
            ],

This rule does not work, if you transfer UserController to controllers, then 'controller' => ['user'] works, but I need the controllers/api directory

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-01-02
@webinar

Everything you need is in the docs:
https://www.yiiframework.com/doc/guide/2.0/en/stru...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question