how to download pdf file from public folder in symfony

  dompdf, download, html, php, symfony

I’m using dompdf to generate invoices from html template, every work perfectly and the invoices are saved in the database with absolute filepath and filename, when I access to public/invoices I found all my pdf file there, I want to make a link button to download or open in the browser the file.

I create a link that take the absolute file like that :

{% for invoice in invoices %}
  <td> {{ }} </td>
  <td>{{ invoice.fileName }}</td>
  <td>{{ }}</td>
  <td>{{ }}</td>
  <td>{{ | date('d-m-Y') }}</td>
  <td><a href="" class="btn btn-sm btn-outline-danger">Archiver</a></td>
  <td><a href="{{ asset('invoices/' ~ invoice.filePath) }}) }}" style="color: #DDDDDD" class="btn btn-sm btn-dark"><i style="padding-right: 10px" class="fa fa-download"></i>Télecharger</a>
{% endfor %}

I got this error :

No route found for "GET
(from "")

Source: Symfony Questions