I have several controllers. What i want to do is to make their web interface like pure REST. The problem is that im unsure where i should declare the routes. Should it always be in main.php or in the controller?
In the topic about routing, the author wrote that, in order to declare a route, i need to do something similar to: array(‘route1’, ‘pattern’=>‘pattern1’, ‘urlSuffix’=>’.xml’, ‘caseSensitive’=>false)
In main.php. Routing is already done when application instantiates the controller, so controller classes can’t declare additional routes.
Both formats are valid and will be recognized by urlManger but the second doesn’t allow you to declare multiple routes with the same pattern. Use the first format for a RESTful interface.