-
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
Finding and replacing a string with another. Template processor #631
Comments
For templates only you can replace by variables. There is no search and replace feature for templates, yet. But maybe you can read content of docx, and make string replace then save you docx as new file. |
Yes sure, I tried to follow this approach that u just mentioned. but What i could understand was there was a phpword object --> section --> abstract-container--> addText() function. but I was unable to understand where the text was actually stored. |
@ozilion Could you please tell how can I define variables in a docx template? I'm using Office for Mac but couldn't find any ways of doing so. Thanks! |
@ngocketit just put your variables between ${ and } without spacesand in your code, use as setValue($variable, $value) |
@ozilion Thanks a lot! It's as that simple and I got it work now. |
Hi ,
Currently I am working with PHPWord , and I am trying to replace one string with another.Is there some way that I can do this. I have looked into the TemplateProcessor but am unable to find any solution for this. Can u kindly guide me in this regard.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: