<?php
namespace App\Controllers;
use ZipArchive;

class ExportController
{
    public function issue($issue_id)
    {
        $zip=new ZipArchive();
        $file="issue_$issue_id.zip";
        $zip->open($file,ZipArchive::CREATE);
        $zip->addEmptyDir("issue");
        $zip->close();

        header("Content-Type: application/zip");
        header("Content-Disposition: attachment; filename=$file");
        readfile($file);
        unlink($file);
    }
}
