Forum


Replies: 4   Views: 6959
Createdocxfromtemplate is not available
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 esai  · 08-11-2014 - 11:08

We are testing with the demo license on osx and linux wit ZF2. I checked the example code (examples/Templates/...) I realised that I was not calling the function properly. This was my mistake. This is our code now: Module.php: public function getAutoloaderConfig() { return array( 'Zend\Loader\ClassMapAutoloader' => array( __DIR__ . '/autoload_classmap.php', array( 'CreateDocx' => __DIR__ . '/../../external/phpdocx/classes/CreateDocx.inc', ), ), 'Zend\Loader\StandardAutoloader' => array( 'namespaces' => array( // if we're in a namespace deeper than one level we need to fix the \ in the path __NAMESPACE__ => __DIR__ . '/src/' . str_replace('\\', '/' , __NAMESPACE__), ), ), ); } And in the controller: ... /* * First we must call CreateDocx() because that loads the requires phpdocx code. */ $docx = new \CreateDocx(); /* * Now we can use the actual template class. */ $docx = new \CreateDocxFromTemplate($templatefile); .... Now CreateDocxFromTemplate() works and we can continue evaluating. Thanks.