-
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
Remove unused template variables #1868
Labels
Comments
A solution I am currently using is to run this code after filling out the document.
This will get all unused variables and set them to an empty string. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I have dynamic values which are adding into templates which should replace, but sometimes there is possibility to use some variable, sometimes not, and I need them to be removed if it was not set
Describe the solution you'd like
Replace every ${anything} which was not set with $this->setValue('anything', 'something') to be replaced with empty string
Describe alternatives you've considered
It is difficult to preset all values as empty which could be used because they are pretty dynamic
Additional context
For example I have clients which might have some sub client below him (I use dots as separator)
for example
${user.name}
and
${user.subuser.name}
but that ${user.subuser.name} is only available if he is set , what is not always and than that ${user.subuser.name} is left in my word file even if it shouldn't be
This is simplified, this problem would be pretty easy solvable like this , but it is more complex , imagine it more recursive
So just to sum it up, I just need something which remove all unreplaced/unused ${anything}
The text was updated successfully, but these errors were encountered: