title: Yii2 sendfile response
body: <p>I am new to <code>Yii2</code> and I would really appreciated if anyone could help me to solve the problem. I want to make a download link and I use</p>
  
  <pre><code>Yii::$app-&gt;response-&gt;sendFile($path, $name, ['inline' =&gt; false])-&gt;send();
  </code></pre>
  
  <p>in download function but it just read the content of the file and display straight in the page. What I want to do is when users click the download link, the download dialog will pop up or the file will be automatically downloaded, rather than display the content. Can anyone please help me?</p>