No reply so far, strange. So after some playing around, here is how I got it to working:
The answer I have posted earlier worked, but was not clean.
Here is a way better method to use PHPRTFLite with CakePHP 1.3.
Step 1) Put the phprtf folder in the vendors folder in CakePHP
So ls in vendors will look like this will look like this:
phprtf
shells
ls in ..\vendors\phprtf will look like this:
PHPRtfLite (Directory)
PHPRtfLite.php
Step 2) Open this file: ..\config\bootstrap.php and enter the following inside:
// The below lines will load the PHPRtfLite classes when required.
function loader($className){
$classFile = '../vendors/phprtf/' . str_replace('_', '/', $className) . '.php';
// check if file exists
if(file_exists($classFile)) {
require $classFile;
}
}
spl_autoload_register('loader');
So now you can use the PHPRtfLite classes in your Models to generate documents. I think they can be used from Controllers as well, but I haven't tried.
You can add more checks and so on to the code in the bootstrap.php if required.
I hope this helps someone. If you have comments, please let me know.
Cheers,
Tony.