Answer the question
In order to leave comments, you need to log in
What is the easiest way to parse url in Yii2 RESTapi?
Hello!
here is the array in UrlManager config
[
'class' => 'yii\rest\UrlRule',
'controller' => [
'api/dashboard',
'api/user',
'api/post',
],
'extraPatterns' => [
'POST list' => 'list',
'POST categorys' => 'categorys',
'POST category-posts' => 'category-posts',
'POST post' => 'post',
'POST search' => 'search',
'POST get-table-list' => 'get-table-list',
'POST get-table' => 'get-table',
'POST get-calendar' => 'get-calendar',
'POST dictionary' => 'dictionary',
]
],
'admin/<controller:\w+>/<action:[a-z\-]*>'=>'admin/<controller>/<action>'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question