Trying to work with RESTfull API with yii (being the first project using yii)
Problem getting URLManager for proper call routing:
'urlManager' => array( 'urlFormat' => 'path', 'showScriptName' => false, 'caseSensitive' => false, 'rules' => array( 'api/<controller>' => array('api/<controller>/list', 'verb' => 'GET'), 'api/<controller>' => array('api/<controller>/create', 'verb' => 'POST'), ), ),
I tried to work with this (this is not a complete fragment, I had dispatchers for PUT / DELETE, etc. But this did not work ... Being desperate, I even tried something simple:
'urlManager' => array( 'urlFormat' => 'path', 'showScriptName' => false, 'caseSensitive' => false, 'rules' => array( 'tezt' => array('landing/beta', 'verb' => 'GET'), 'tezt' => array('landing', 'verb' => 'POST'), ), ),
whenever I delete one of the rules, it works, but when I insert both rules, neither of them works, I get an exception.CHttpException.404 exception
exception 'CHttpException' with message 'Unable to resolve the request "tezt".' in /yii-1.1.10/web/CWebApplication.php:280
Again I hit my head about it for 2 days. They probably looked through all the URLManager samples and tutorials on the Internet (although they could not find a simple and complete explanation of the rules). But there is no joy.
Am I doing something wrong? Perhaps this is my box installation?