Hi, i’m trying to get a rest api using 2.0. I have the default actions on a controller working fine but I’m tying to extend the actions I can do. I think that as well as having a new action I must also use behaviours to set what is possible with each new action, so I have added this to my controller.
Stepping through the urlmanager it became apparent that the leading slash was not needed as it created a rule that contained ‘//’ Changing it to this then worked fine.
Your problem is that you have overridden the behaviors() method completely. The parent classes have behaviors attached that negotiate the content headers and response format. To get round this your behaviors needs to return an array merged with the parent behaviors. So your behaviors() method will look like this;