-
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
Delete text from section #1303
Comments
please try out the dev-develop version? $section->removeElement($elementToRemove); $elementToRemove can either be the element itself, or an integer representing the position in the elements array to remove. |
@maba4891 BTW, you should use |
Thanks for the quick reaction! 👍 I am busy with another urgent project right now but will have a look at it asap and will report back here :) |
@troosan Looking forward for the |
Here's the thing: I create a phpword object and add sections and text. But before I write the object to the final docx document I need to look at the whole thing again and might have to make some changes (especially deleting text again). It would be nice to do this at the end because I have a lot of complex conditions on how to fill the object.
Here is where I am so far:
The question now is: How can I delete elements???
Of course I can get the elements from $section via getElements():
But that only deletes the text from the $section_elements array and leaves the phpword object untouched. So how can I delete elements from the phpword object itself before writing it to a docx file?
Thanks!
The text was updated successfully, but these errors were encountered: