/** * Creating and Exporting a Zip * @Route /new/example/exportzip * */ public function exportZipAction() { $zip = new \Raptor\Util\Zip(); /** * Give the directory or a file to compress * in this case will be the Controller directory * of this bundle */ $zip->create(__DIR__); $this->app->contentType(\Raptor\Raptor::ZIP); $this->app->response()->headers()->set('Content-Disposition', 'attachment; filename="testing.zip"'); return $zip->output(); }