-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set complex type in template #1565
Set complex type in template #1565
Conversation
someone can approve this function? |
don't worry, it's approved. I only need to release the next version. Will do so soon |
oke thanks @troosan |
I know it's not an official release yet, but I was testing this functionality and noticed that, unlike In the test I did, it only changes the first occurrence. Should that be? $templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor($originalFile);
$inline = new TextRun();
$inline->addText("NewValue", array('italic' => true, 'color' => 'red'));
$templateProcessor->setComplexValue("old_value", $inline);
$templateProcessor->saveAs($originalFile); |
@joao-vieira indeed, you are right. If you have multiple placeholders to replace you'll have to call the replace multiple times. |
Description
This Pull Request allows to insert a
ComplexType
in a Template.Checklist:
composer run-script check --timeout=0
and no errors were reported