title: A custom sorter for ListView in Yii2
body: <p>Standard ListView widget automatically generates a kind of sorter by having the <code>{sorter}</code> section in its <code>$layout</code> property. However, I need a more sophisticated sorter with a custom template for my product list.</p>
  
  <p><img src="https://i.stack.imgur.com/21sTs.png" alt="sorter template"></p>
  
  <p>Essentially I need to be able to:</p>
  
  <ol>
  <li>Sort the list by several fields (popularity, newness, price, etc.)</li>
  <li>Select how many entries per page to show (12, 50, 100)</li>
  <li>Switch between two different view templates (more/less product information)</li>
  </ol>
  
  <p>At this point I am trying to understand if I need to create a class descendant from <code>ListView</code> or I can configure the properties of the existing classes.</p>
  
  <p>What is the best practice for implementing something like this?</p>