Cant use tockens and extrapattern together for REST services in Yii2 -


yii2 rest query

i found using custom action in controller added extrapattern mentioned in above link

and working fine when search .but cant use normal actions controller

'urlmanager' => [         'enableprettyurl' => true,         'enablestrictparsing' => true,         'showscriptname' => false,         'rules' => [             [                 'class' => 'yii\rest\urlrule',                  'controller' => 'v1/country',                 'extrapatterns' => [                     'get search' => 'search'                     ],                 'tokens' => [                     '{id}' => '<id:\\w+>'                 ]              ]         ],             ] 

regards

thanks all

this solved problem after lots of trying..

          'rules' => [             [                 'class' => 'yii\rest\urlrule',                  'controller' => 'v1/country',                 'extrapatterns' => [                     'get search' => 'search'                     ],                              ],             [                 'class' => 'yii\rest\urlrule',                  'controller' => 'v1/country',                 'tokens' => [                     '{id}' => '<id:\\w+>'                 ]              ],          ],  

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -