Forum


Replies: 3   Views: 3911
Php fatal error: uncaught error: call to undefined method phpdocx\\create\\createdocx::replacevaria
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 admin  · 19-01-2018 - 15:01

Hello,

We recommend you to check the included samples in your package and the practical guide explains how to use both packages (classic and namespaces). For example on https://www.phpdocx.com/documentation/practical/working-with-templates you can read about how to use the included autoloader or you can integrate it with Composer (https://www.phpdocx.com/documentation/cookbook/integrate-phpdocx-with-composer).

For example, the included sample Core\addText\sample_3.php that use CreateDocx and WordFragment:

<?php

require_once '../../../Classes/Phpdocx/Create/CreateDocx.inc';

$docx = new Phpdocx\Create\CreateDocx();

//create a Word fragment with an image
$image = new Phpdocx\Elements\WordFragment($docx);
$imageOptions = array(
    'src' => '../../img/image.png',
    'scaling' => 50, 
    'float' => 'right',
    'textWrap' => 1 
    );
$image->addImage($imageOptions);

The library includes various folders because each folder is a PHP namespace (this is how PHP namespaces work). If you don't want to use PHP namespaces, you can download and use the classic package on MY PHPDOCX page after login.

Regards.