[TYPO3-mvc] Referencing a PHP file, using Extbase

Robert Schneider r.schneider at artworx.at
Wed Aug 1 14:38:52 CEST 2012


Hi,

this is maybe an stupid request. I don't know. I'm still new to 
Typo3/Extbase and even PHP.

I have to create a CSV download (export) in the backend module of an 
extension. Therefore I created a PHP script to make such things like:

header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=file.csv");
header("Pragma: no-cache");
header("Expires: 0");
...
and then generating the file content (there is no physical file).

This is not inside a class that is derived from an Extbase class (like 
ActionController). So the script is not executed or used like my 
extension classes.

In my Fluid template the file is referenced with a a-tag.

Now I have to access the repository of the model to get the data.

If I do t3lib_div::makeInstance('myrepository') I need to include 
class.t3lib_div.php. I have done it this way:

require_once '../../../../../t3lib/class.t3lib_div.php';

Ugly... And then I have noticed that I need to include even more. 
Extbase stuff and so on. The question is, how do I include this all 
classes of typo3, extbase and what ever I need? Or ist this not 
possible? Do I have to include each file manually (e.g. 
RepositoryInterface)?

How do I do this? The CSV is not the issue. Just accessing those 
classes. There must be simple way...

Thanks and regards,
Robert



More information about the TYPO3-project-typo3v4mvc mailing list