質問

I have the following rule, in my config/main.php:

'<controller:\w+>/<action:\w+>/<param:\w+>'=>'<controller>/<action>',

Can I have in ExperienceController an action actionListByDistrict($param) that is called when the URL /mysite/experience/district/value is used?

I would like to do a kind of mapping in Yii Framework, but how? Actually the action takes this form: actionDistrict($param).

役に立ちましたか?

解決

The rule that I mention on the comment should work:

'experience/district/<param:\w+>'=>'experience/listByDistrict'

Make sure this specific rule stays on top, because the order on Yii UrlManager Rules matters.

About the general rule however, I don't see way for doing it atm.

:)

他のヒント

You can try that 'experience/district/<id:\d+>'=>'experience/listByDistrict/',

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top