Skip to content

Instantly share code, notes, and snippets.

@gravitano
Last active August 29, 2015 13:59
Show Gist options
  • Save gravitano/10957634 to your computer and use it in GitHub Desktop.
Save gravitano/10957634 to your computer and use it in GitHub Desktop.
My Helpers
<?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