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

Add getVariableCount method in TemplateProcessor #1272

Merged
merged 6 commits into from
Dec 11, 2018

Conversation

nicoder
Copy link
Contributor

@nicoder nicoder commented Feb 5, 2018

add getVariableCount method to TemplateProcessor

it returns how many times each placeholder is present in the document

it is almost the same code as getVariables (which was refactored to use it).

we found such a function useful when cloning a block a number of times and we wanted to replace
placeholders that are present more than once in the block
(using the $limit parameter of setValue)

of course feel free to refuse this pull request if you do not think it would be of general interest.

returns how many times each placeholder is present in the document

almost the same code as `getVariables`

useful when cloning a block a number of times and want to replace
placeholders that are present more than once in the block
(using the `$limit` parameter of `setValue`)
Copy link
Contributor

@ndench ndench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great PR. Thanks for the contribution!

@troosan troosan changed the title Add getVariableCount method Add getVariableCount method in TemplateProcessor Jul 21, 2018
@troosan troosan added this to the v0.16.0 milestone Dec 11, 2018
@troosan troosan merged commit 0db21ae into PHPOffice:develop Dec 11, 2018
@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 94.667% when pulling b188ab9 on nicoder:add-getVariableCount-method into cf3132a on PHPOffice:develop.

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.

4 participants