-
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
cloneBlock/deleteBlock #2353
Comments
see there : #2217
|
$doc->deleteBlock('blockName'); doesn't work. but $doc->replaceBlock('blockName', '' ); works except that you then have to delete the tags as well. $doc->setValues(array('blockName' => '', '/blockName' => '' )); |
This just saved me from giving up on a big, paid project! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi everybody,
How is it possible that this code in the same template sometimes works and sometimes not
Template docx contains block eg.:
${BlockName}
<spreadsheet.....>
${/BlockName}
php code is:
$templateProcessor->cloneBlock('returnblock', 0, true, false, null);
After generate document by templateprocessor I want to get this output:
![Képernyőfotó 2022-12-07 - 16 49 38](https://user-images.githubusercontent.com/120027778/206225882-a1e3e84c-87c0-4a47-93d6-bb885cd59cd0.png)
I have tried to put this code to the beginning or the end, but it not works always.
I have tried the following codes also to clear the block, but it not works, and templateprocessor not deleted the returnblock.
$templateProcessor->deleteBlock('returnblock');
$templateProcessor->cloneBlock('returnblock', 0, true, true);
$templateProcessor->cloneBlock('returnblock', 0, true);
$templateProcessor->replaceBlock('returnblock', '');
Does anyone know what is the secret?
The text was updated successfully, but these errors were encountered: