Created
March 4, 2014 08:10
-
-
Save edomaru/9342207 to your computer and use it in GitHub Desktop.
The simple way to export excel from codeigniter
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 | |
class Eksport extends CI_Controller { | |
function export() { | |
$file_name = "Nama file.xls"; | |
header("Content-type: application/vnd.ms-excel"); | |
header("Content-Disposition: attachment; filename={$file_name}"); | |
header("Expires: 0"); | |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); | |
$data = array( | |
// define your selfe | |
); | |
$this->load->view("view_name", $data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment