Skip to content
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

setComplexValue does not seem to work with list item? #1667

Open
yellow1912 opened this issue Jul 17, 2019 · 5 comments
Open

setComplexValue does not seem to work with list item? #1667

yellow1912 opened this issue Jul 17, 2019 · 5 comments

Comments

@yellow1912
Copy link

Describe the Bug

I may be doing something wrong here, but I'm trying to see if I can set complex html such as a list using the setComplexBlock.

Steps to Reproduce

My sample code looks like this:

<?php
require __DIR__ . '/vendor/autoload.php';

$phpWord = new \PhpOffice\PhpWord\PhpWord();
$sec = $phpWord->addSection();
Html::addHtml($sec, '<ul><li>text with entities my text</li><li>text with entities my text</li></ul>aaaaa<ol><li>text with entities my text</li><li>text with entities my text</li></ol>');

$templateProcessor->setComplexBlock('replace1', $sec->getElement(0));
$templateProcessor->setComplexBlock('replace2', $sec->getElement(1));
$templateProcessor->setComplexBlock('replace3', $sec->getElement(3));
$templateProcessor->setComplexBlock('replace4', $sec->getElement(4));

Expected Behavior

I expected the list items to be printed out

Current Behavior

They are printed out as normal text, not list items.

Context

Please fill in your environment information:

  • PHP Version: 7.2
  • PHPWord Version: latest
@dayofr
Copy link

dayofr commented Jan 8, 2020

Hi thanks for this lib.

Are there any news on this?
I'm trying to add a list with the TemplateProcessor but I'm unable to do so.

@Gadeoli
Copy link

Gadeoli commented Dec 7, 2020

Hi,

setComplexValue looks not work to replace values in header/footer for me.

@kalibano
Copy link

any update on this ?

@hasanablak
Copy link

any update?

1 similar comment
@idem84
Copy link

idem84 commented May 14, 2024

any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants