1 2 3 4 5 6 7
<?php $this->response->header(['Content-Disposition: attachment; filename="downloaded.pdf"']); $this->response->type('pdf'); $this->response->send(); echo $this->fetch('content'); ?>