Hi, I'm trying to create a snippet that creates an odt-file. This is the library:
https://github.com/cybermonde/odtphp
This is my snippet:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once($modx->getOption('core_path') . 'components/odtphp/Odf.php');
$odf = new odf(MODX_CORE_PATH .'components/odtphp/templates/test.odt');
$odf->setVars('title', 'Dit is een testtitel');
$message = 'Dit is de inhoud';
$odf->setVars('message', $message);
$odf->exportAsAttachedFile();
?>
I placed the files in the correct folder. (core/components/odtphp/)
Without the first two lines the page just doesn't display (500 internal server error). With the two lines I get:
Fatal error: Class 'odf' not found in /home/domain/domains/mydomain.nl/public_html/core/cache/includes/elements/modsnippet/137.include.cache.php on line 14
Does anyone know what could be wrong? Is it possible to do this in MODX like this at all?
Thanks for any help!!
[ed. note: michelle84 last edited this post 10 years ago.]