create
[ class tree: create ] [ index: create ] [ all elements ]

example

  1. <?php
  2.  
  3. /**
  4.  * Replaces a PHPDocX template variable by an external MHT document.
  5.  *
  6.  * @category   Phpdocx
  7.  * @package    examples
  8.  * @subpackage easy
  9.  * @copyright  Copyright (c) 2009-2013 Narcea Producciones Multimedia S.L.
  10.  *              (http://www.2mdc.com)
  11.  * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
  12.  * @version    2012.12.26
  13.  * @link       http://www.phpdocx.com
  14.  * @since      2012.12.26
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19.  
  20. $docx->addTemplate('../files/TemplateText.docx');
  21.  
  22. $docx->addTemplateVariable('WEIGHT1''10');
  23. $docx->addTemplateVariable('WEIGHT2''20');
  24. $docx->addTemplateVariable('WEIGHT3''25');
  25.  
  26. $docx->addTemplateVariable('PRICE1''5');
  27. $docx->addTemplateVariable('PRICE2''30');
  28. $docx->addTemplateVariable('PRICE3''7');
  29.  
  30. $docx->addTemplateVariable('TOTALWEIGHT''55');
  31.  
  32. $docx->addTemplateVariable('TOTALPRICE''42');
  33.  
  34. $docx->addTemplateVariable('NAME',
  35.                            '../files/Web.mht',
  36.                            'mht');
  37.  
  38. $docx->createDocx('../docx/example_template_mht');

Documentation generated on Mon, 13 Jan 2014 13:44:10 +0100 by phpDocumentor 1.4.4