Why is this error Setting unknown property: yii\web\UrlRule?

Created a folder api in it config/main.php here is the rule
it created a module and in the module controller BonusController it actionsGetBonus
'urlManager' => [
 'enablePrettyUrl' => true,
 'enableStrictParsing' => true,
 'showScriptName' => false,
 'rules' => [
[
 'class' => 'yii\rest\UrlRule',
 'controller' => ['v1/bonus'],
 'extraPatterns' => [
 'GET bonus' => 'get bonus',
]
]
],
 ],

trying to find it at site.loc/api/web/v1/bonuses/get-bonus?id=1 get error Setting unknown property: yii\web\UrlRule what am I doing wrong
June 14th 19 at 20:01
1 answer
June 14th 19 at 20:03
the mistake was that I called the array in the array so I have
'rules' => [
[
 'class' => 'yii\rest\UrlRule',
 'controller' => ['v1/bonus'],
 'extraPatterns' => [
 'GET bonus' => 'get bonus',
]
]
 ],

and it was so
'rules' => [

 'class' => 'yii\rest\UrlRule',
 'controller' => ['v1/bonus'],
 'extraPatterns' => [
 'GET bonus' => 'get bonus',
]

 ],

Find more questions by tags Yii