|
Stud.IP
2.4 Revision 48548
|


Public Member Functions | |
| addPage () | |
| addContent ($content) | |
| dispatch ($filename) | |
| save ($filename, $folder_id=null) | |
This interface describes a basic structure for a class that exports content or many contents within a document. It is used in ExportPDF, but could be used for classes that export Excel or OpenDocument files as well. The main operation to get a document by stud.ip-formatted text is quite simple:
$doc = new ExportPDF(); $doc->addPage(); $doc->addContent('Hallo, %wir%% benutzen :studip: -Formatierung.'); $doc->dispatch("test_pdf"); //lines following dispatch won't be accessed anymor, because dispatch //cancels all other output.
| addPage | ( | ) |
Adding a new page to write new content on it. Must be called at least once before any call of addContent($text).
| dispatch | ( | $filename | ) |
Outputs the content as a file with MIME-type and aborts any other output.
| string | $filename | name of the future file without the extension. |
Implemented in ExportPDF.
| save | ( | $filename, | |
$folder_id = null |
|||
| ) |
Saves the content as a file in the filesystem and returns a Stud.IP-document object.
| string | $filename | name of the future file without the extension. |
| mixed | $folder_id | md5-id of a given folder in database or null for nothing |
Implemented in ExportPDF.