That's good news. I'm glad I'm doing something wrong. I figured it made sense to be able to add cross references on fragments.
I'm using 5.5 trial at the moment. I believe we are about to purchase the Corporate version of 6.0. Waiting on the final approval for that.
Here's my whole php file.
<?php
//path to the CreateDocx class within your PHPDocX installation
require_once 'phpdocx/classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->addText("Blargity blarg-blarg blarg.");
$xref = new WordFragment($docx);
$xref->addCrossReference("blah", array("type" => "bookmark", "referenceName" => "blah"));
$docx->addText($xref);
$docx->createDocx('document');
echo "<a href='document.docx'>Document</a>";
And here is the error message I'm getting on the server.
[Fri Jun 17 08:42:13.892890 2016] [:error] [pid 2082] [client 192.168.56.100:61678] PHP Fatal error: Call to undefined method WordFragment::addCrossReference() in /webdevroot/Test/DocGen/sandbox.php on line 11
Am I missing something here?
Thanks,
Andrew