Last active
August 29, 2015 13:59
-
-
Save gravitano/10957634 to your computer and use it in GitHub Desktop.
My Helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// translator | |
function __($id, array $replace = array(), $locale = 'en') | |
{ | |
return Lang::get('app.'.$id, $replace, $locale); | |
} | |
// file download | |
function set_download_header($filename) | |
{ | |
header("Pragma: public"); | |
header("Expires: 0"); | |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); | |
header("Content-Type: application/force-download"); | |
header("Content-Type: application/octet-stream"); | |
header("Content-Type: application/download");; | |
header("Content-Disposition: attachment;filename=$filename"); | |
header("Content-Transfer-Encoding: binary "); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment