title: RESTful Server Design in Yii
body: <p>Hi i have been trawling the net in search of as much info i could get my mits on about creating a restful server in the Yii framework. </p>
  
  <p>All the examples i have found so far have dealt with writing a restful application that deals with one model (IE Topic Or Posts)</p>
  
  <p>The crux of my question is this, How should i deal with writing a restful server that deals with alot of Model types, ie client, brand, project, task?</p>
  
  <p>Each Model object will need CRUD operations to be implemented so for example
  To create a new brand the system requires a Client Id as will the other CRUD operations.</p>
  
  <p>Should each Model Object have its own RESTFUl server or should there be come kind of controller that routes the RESTFUL requests to the corresponding Rest controller for the model object?
  Should there be one Server that dynamically decides what model to work with like a switch (not keen on this idea personally)</p>
  
  <p>Any kind of advice of how to achieve this kind of rest architecture would be really great</p>
  
  <p>I think its also worth noting that the server i am building will be working with sproutcore on the front end and will only be returning JSON so any kind of format detection will not be required. </p>