Register Lost your password?
Full api documentation: full api documentation FREE version full api documentation PRO version

public function addTemplate(filePath)

This method allows the user to build a Word document up from an existing template, something particularly useful when aonly a few elements have to be generated dinamically.

Parameters

filePath : document path to use as template

Variables in Word document must be $VARIABLE$. The variable is replaced with the assigned value.

Examples

Example Version Pro


require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$docx->addTemplate('TemplateText.docx');
$docx->createDocx('template_text.docx');

    3 Responses

  • What’s new on PHPdocX 1.6? | PHPDOCX

    [...] There are two new functions for tables and templates: fAddTable and fAddTemplate. [...]

  • mirulu

    Why, Call to undefined method CreateDocx::fAddTemplate() ???

  • turbo124

    can you merge multiple templates into a document?

Your comments