title: Yii2 Restful Filtering and Searching
body: <p>I referred to <a href="https://stackoverflow.com/questions/5020704/how-to-design-restful-search-filtering">this</a> generic post on Restful search/filtering. However I am trying to design it using Yii2. I want use the basic yii2 capabilities of searching through ModelSearch and make the result accessible as RESTFul endpoints.
  My objective is two fold which let me put forward as a use case and what I have built until now.</p>
  
  <pre><code>GET http://app.com/api/v1/cars returns the list of cars
  GET api/v1/cars/1 returns the car at id 1
  POST api/v1/car creates a new car
  PUT api/v1/cars/1 modifies the car at id 1
  </code></pre>
  
  <p>The car table has various columns such as name, manufacturer, alternate_name. I would like user to search/filter against each of these columns. I can imagine of implementing it this way</p>
  
  <pre><code>GET api/v1/cars?name=Audi
  GET api/v1/cars?technical_name=Quattro
  </code></pre>
  
  <p>Second scenario is of a global search wherein any input by user would match across all the columns at once. I thought of implementing it this way:</p>
  
  <pre><code>GET api/v1/cars?search=query
  query="Le mans german manufacturer"
  </code></pre>
  
  <p>So, I have two questions. What are the pros and cons to this design? And how do I implement it using the default Yii2 rest implementation (yii\rest\ActiveController)?</p>