[module.professor.pdf] Generate PDF link

This commit is contained in:
xdrm-brackets 2018-03-21 14:54:42 +01:00
parent 2c0681dd7c
commit 6273a58046
2 changed files with 9 additions and 2 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/node_modules /node_modules
/backup /backup
/tmp /tmp
/public_html/tmp

View File

@ -140,9 +140,15 @@ class pdfController{
$body = self::generate_pdf_body($data); $body = self::generate_pdf_body($data);
/* (2) Set headers */ /* (2) Set headers */
$fullname = $data['prof']['firstName'].' '.$data['prof']['lastName'];
$date = date('d-m-Y');
$title = "Fiche enseignant - $fullname ($date)";
$headers = [ $headers = [
'Content-Description' => 'File Transfer', // 'Content-Description' => 'File Transfer',
'Content-Transfer-Encoding' => 'binary', 'Content-Transfer-Encoding' => 'binary',
'Content-Disposition' => 'attachment; filename=\"'.$title.'\"',
'Cache-Control' => 'public, must-revalidate, max-age=0', 'Cache-Control' => 'public, must-revalidate, max-age=0',
'Pragma' => 'public', 'Pragma' => 'public',
'X-Generator' => 'mPDF', 'X-Generator' => 'mPDF',