title: Yii2 download model as an excel file
body: <p>I'm working on a Yii2 rest Api that's connected to AngularJS front end.</p>
  <p>I'm trying to build an <code>actionDownloadAsExcel</code> method that can help me download a specific model. What would be a good way to do this?</p>
  <p>I installed &quot;phpOffice\phpExcel&quot; but I don't really know how to use it for my purpose.</p>