Forum


Replies: 3   Views: 348
Replacevariablebyhtml css not applying
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 jennygj  · 26-02-2024 - 14:09

Hi

Could you advise why the styles in $testValue may not be applied during docuemnt creation?

$placeholder = '$EXAMPLE$';

$testValue = '<style>p {color:red; font-weight:bold;}></style><p>Test HTML</p>';

$docx->replaceVariableByHTML($placeholder, 'inline', $testValue, ['addDefaultStyles' => false]);