TYPO3 6.1
我正在为我的extbase扩展编写一个tcemain钩子 . 我已经在“myextension / Classes / Hooks / myTcemainHook.php中包含了这个钩子php文件 . 在这个钩子里,当我在后端保存记录时,我正在操作来自tca的数据 . 而且我正在将操作数据写入某个文本文件 .
目前我在字符串中获取操作数据并将该字符串写入文件,如下所示
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);
}
但在这里,我的要求是使用流体模板 . 因此,文件内容必须使用流体模板格式化,然后应写入文件 .
怎么做到这一点?有帮助吗?
1 回答
看一下独立视图:
http://forge.typo3.org/projects/typo3v4-mvc/wiki/How_to_use_the_Fluid_Standalone_view_to_render_template_based_emails