Answer the question
In order to leave comments, you need to log in
How to link correctly?
Given: Yii 1.1.16
rules=>[
array('mobile/api/list', 'pattern' => 'mobile/api/<model:\w+>', 'verb' => 'GET', 'parsingOnly' => true),
array('mobile/api/view', 'pattern' => 'mobile/api/<model:\w+>/id/<id:\d+>', 'verb' => 'GET', 'parsingOnly' => true),
]
$this->createUrl('api/games/id/',array('id'=>$ID))
/mobile/api/games/id?id=20
/mobile/api/games/id/20
Answer the question
In order to leave comments, you need to log in
1. Swap the rules.
2. model must also be specified.
3. parsingOnly means that the rules do not work when creating a URL.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question