Cant use tockens and extrapattern together for REST services in Yii2 -
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
Post a Comment