Skip to content
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

Allow a closure to be passed with image replacement tags #1716

Merged
merged 3 commits into from
Feb 5, 2021

Conversation

mbardelmeijer
Copy link
Contributor

Description

This PR adds support to supply a closure to the setImageValue call on the TemplateProcessor class.

Usage case: we generate serveral documents based from templates and supply a set of replacement tags. One of these tags contains a image that's generated on the fly which results in a performance impact. We must generate this image on every document as we aren't sure if the template contains the replacement tag in question.

This ensures the generation only happens when the tag is found and the TemplateProcesser want's to inject the image.

Fixes # (issue)

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
    Ran the test suite but was unable to run the php-cs script due to what i think are filemode issues on Bash on Windows (the CS script wanted to change all files).
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

@troosan troosan added this to the v0.18.0 milestone Nov 22, 2020
@troosan troosan merged commit 4e87e72 into PHPOffice:develop Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants