So I am building this simple RESTful API with 1.1.7’s new feature. In main.php I have added the following rules to the urlManager:
'api/<controller:\w+>' => array('<controller>/index', 'verb'=>'GET'), 'api/<controller:\w+>' => array('<controller>/create', 'verb'=>'POST'),
I expected that Yii would sort the actions according to the HTTP verb.
What happens is that either rule works alone, and even filters the verb, but when I put them together, I get a 404. It’s like when I both rules, Yii can’t decide which one applies.
Am I doing something wrong? I can get a workaround to do this, but I feel that this approach is the most RESTfully and Yiily way to do it.