0

I want to write rule for below url but i am unable to write.

I have tried this but it is wrong

'member/find/<SearchForm[city]>/<SearchForm[location]>' => 'member/find' 

How should i write rule for below url?

member/find?SearchForm[city]=dilli&SearchForm[location]=chandnichowk

Vikram Pote
  • 5,433
  • 4
  • 33
  • 37
  • I am not sure I understand you very well but check this [answer](http://stackoverflow.com/a/39999558/372580) if it can help – mmonem Oct 22 '16 at 20:40

1 Answers1

0

So if "member" here is the name of your controller and "find" is the name of the action you should put something such as:

['class' => 'yii\rest\UrlRule',
    'controller' => ['member'=> 'member'],
    'extraPatterns' => [
        'GET find/<city>/<location>' => 'search',
    ]
],

this should map to public function actionFind($city,$location){}

mrateb
  • 2,317
  • 5
  • 27
  • 56