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

How to dynamically output multiple tables in a template? #2065

Closed
zhaoguocaomin opened this issue Apr 19, 2021 · 2 comments
Closed

How to dynamically output multiple tables in a template? #2065

zhaoguocaomin opened this issue Apr 19, 2021 · 2 comments

Comments

@zhaoguocaomin
Copy link

image

@zhaoguocaomin
Copy link
Author

zhaoguocaomin commented Apr 21, 2021

    $count = count($productList);
    // clone block
    $templateProcessor->cloneBlock('productions', $count, true, true);

    // set block
    foreach ($productList as $key => $value) {
        $search = 'productInfo#' . ($key + 1);
        $table = $this->getTable($value);
        
        $templateProcessor->setComplexBlock($search, $table);
    }

tpl.docx
${productions}
${productInfo}
${/productions}

@jorge-koki
Copy link

Hello, could you give more details about this? What does the function $this->getTable($value);

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

No branches or pull requests

2 participants