PHPWord icon indicating copy to clipboard operation
PHPWord copied to clipboard

Set the variable syntax customizable

Open FlorianBaba opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

We implemented PhpWord for variables detection & replacement and it works well :ok_hand:

The problem is {{ }} variable syntax was needed in our case, but PhpWord actually used syntax ${ }. So to fit our needs we did a monkey patch with a TemplateProcessorDecorator, but it's not a strong way to go...

Describe the solution you'd like

A solution would be to set the variable syntax customizable via the configuration.

Describe alternatives you've considered

An other solution would be to add the syntax to use as a param of some methods, such as getVariables()

FYI

If the issue is accepted, my team and I will be available to propose a merge-request :+1:

FlorianBaba avatar Jun 24 '22 15:06 FlorianBaba

good idea

raybon-lee avatar Jul 04 '22 14:07 raybon-lee

That would be very usefull !

Clowrid avatar Aug 29 '22 13:08 Clowrid