TYPO3 6.1
I am writing a tcemain hook for my extbase extension. I have included that hook php file in "myextension/Classes/Hooks/myTcemainHook.php. In this hook, I am manipulating datas coming from tca when save the record in backend. And I am writing that manipulated data to some text file.
Currently I am getting manipulated data in string and writing that string to file like below
public function processDatamap_afterAllOperations(&$pObj){
//Write content to a file
$textFileCnt = 'Label: '.'manipulated text content, that needs to write to file';
$textFileCnt .= 'Labe2: '.'manipulated text content, that needs to write to file';
$file1 = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('fileadmin/printer/printer.txt');
\TYPO3\CMS\Core\Utility\GeneralUtility::writeFile($file1, $textFileCnt);
}
But here my requirement is to use fluid template for this. So the file content have to be formatted using fluid template and then should write to file.
How to achieve this? Any help?