Forum


Replies: 2   Views: 3401
Clearbocks doesn't work with content on new lines.
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 lewisrblack  · 23-04-2015 - 08:55

Hi there, I have run a test on the clearBlocks method using the following template: $BLOCK_one$ Here is a test one. $BLOCK_one$ $BLOCK_two$Here is a test two.$BLOCK_two$ In this example, clearBlocks only clears the second block. It appears to not clear a block where the content is over multiple lines. Is this a bug? Thanks, Lewis

Posted by admin  · 23-04-2015 - 09:48

Hello, Clearblocks remove the placeholders variables that start with 'BLOCK_'. If you need to remove the whole content please use the deleteTemplateBlock method. Please check this page: http://www.phpdocx.com/api-documentation/templates/delete-Word-template-block-content Regards.

Posted by lewisrblack  · 23-04-2015 - 12:35

Thanks! Apologies for wasting your time. Lewis