Hello,
I facing the problem when I use replaceVariableByHTML using block parameter replaces the entire line of the variable.
e.g:
// my word file content (document.docx)
/*
Item name: My item
Item Description: $DESCRIPTION$
Price: 999
*/
// and my item description is
$description = 'The Item features a stylish design and <span style="color:orange">innovative</span> features so that you can enjoy using the mobile phone for all that you need.
<br><br>
Warranty card, User guide, Clear soft case, Screen protector are included';
$docx = new CreateDocxFromTemplate('document.docx');
$docx->replaceVariableByHTML('DESCRIPTION', 'block', $description, array('isFile' => false, 'downloadImages' => false));
$docx->createDocx('output');
Problem:
The above code replaces the entire line(Item description line) with the $description.
But I want to keep the Item Description: as well.
I know we can use inline in the second parameter of the replaceVariableByHTML function but I want to use block instead.
Incorrect output:
Item name: My item
The Item features a stylish design and <span style="color:orange">innovative</span> features so that you can enjoy using the mobile phone for all that you need.
Warranty card, User guide, Clear soft case, Screen protector
Price: 999
Expected output:
Item name: My item
Item Description: The Item features a stylish design and innovative features so that you can enjoy using the mobile phone for all that you need.
Warranty card, User guide, Clear soft case, Screen protector are included.
Price: 999