Created
March 30, 2011 19:11
-
-
Save khepin/895067 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 MyExcel { | |
public static function setContent(sfEvent $event, $response) { | |
if (in_array(self::$format, self::$acceptedFormats)) { | |
//add content file | |
$doc = new ZipArchive(); | |
$doc->open(sfConfig::get('sf_data_dir') . '/documents/report/my_report.ods'); | |
$doc->addFromString('content.xml', $response); | |
$doc->close(); | |
} | |
if(self::$format == 'ods'){ | |
$response = file_get_contents(sfConfig::get('sf_data_dir') . '/documents/report/my_report.ods'); | |
} | |
/* ... deal with other formats ... */ | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment