1.how make this url
http://localhost/travia-api/backend/web/v1/flight?id=4FR996IN2F829M
to this
http://localhost/travia-api/backend/web/v1/flight/4FR996IN2F829M
this is my config
'urlManager' => [
'class' => 'yii\web\UrlManager',
'showScriptName' => false,
'enablePrettyUrl' => true,
'rules' => [
'class' => 'yii\rest\UrlRule',
'controller' => 'flight',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:[\w\-]+>/<action:[\w\-]+>/<id:\d+>' => '<controller>/<action>/view',
'<controller:[\w\-]+>/<action:[\w\-]+>/<id:\d+>' => '<controller>/<action>',
'<controller:[\w\-]+>/<action:[\w\-]+>' => '<controller>/<action>',
'v1/<controller:[\w\-]+>/<action:[\w\-]+>/<id:\d+>' => 'v1/<controller>/<action>',
'v1/<controller:[\w\-]+>/<action:[\w\-]+>' => 'v1/<controller>/<action>',
'module/<module:[\w\-]+>/<controller:[\w\-]+>/<action:[\w\-]+>' => '<module>/<controller>/<action>',
],
and this is my htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
2.and when i want to add new pattern i add these line to config
extraPatterns[
'GET search' => 'search'
]
after that i have error like these
Unknown Property – yii\base\UnknownPropertyException Setting unknown property: yii\web\UrlRule::GET search
i did a lot but i couldn't found something useful! thanks in advance!