I have try the template_header.php example... and it runs OK, but if I put these in DOCX:
Weight (Kg) Price (€)
$NMONTE$ $RECINTO$ $SUP$
Total $TOTAL1$ $TOTAL2$
INSTEAD ........
Weight (Kg) Price (€)
$NAME$ $WEIGHT$ $PRICE$
Total $TOTALWEIGHT$ $TOTALPRICE$
--------------------------------
And this in PHP code:
$settings = array(
'header' => true
);
$docx->addTemplateVariable(
array(
array(
'NMONTE' => 'Product A',
'RECINTO' => '10',
'SUP' => '5',
),
array(
'NMONTE' => 'Product B',
'RECINTO' => '20',
'SUP' => '30',
),
array(
'NMONTE' => 'Product C',
'RECINTO' => '25',
'SUP' => '7',
),
),
'table',
$settings
);
$docx->addTemplateVariable('TOTAL1', '55');
$docx->addTemplateVariable('TOTAL2', '42');
$docx->addTemplateVariable('MYNAME', 'David Hume');
The result is:
Weight (Kg) Price (€)
Product A 10 5
Product B 20 30
Product C 25 7
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
Total 55 42
Total 55 42
Total 55 42
Total 55 42
Total 55 42
Total 55 42
What is happen ?¿?¿?¿?