Forum


Replies: 2   Views: 2607
Class 'wordfragment' not found
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by AngelaE  · 10-11-2017 - 10:38

Hello,

I'm using phpdocx advanced 7.5, and everything has been working fine until I tried using Word Fragments and got the following error: Class 'WordFragment' not found. I've included CreateDocx.inc but it doesn't seem to be autoloading the WordFragment class. Adding an include statement for WordFragment doesn't work either.

Posted by admin  · 10-11-2017 - 12:34

Hello,

Which package are you using? classic or namespaces?

We recommend you to test the included samples, such as the included in the addText folder that use WordFragments; maybe your scripts are missing something.

Regards.

Posted by AngelaE  · 10-11-2017 - 13:59

Thanks for pointing me to the samples. After taking a look, I realized I should have been using:

new Phpdocx\Elements\WordFragment

 instead of: 

new WordFragment

This topic can be closed.