-
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
Allow to Separate Variables and Blocks #2444
Comments
I give example for this request:
From now, you have to call on your php code cloneBlock, then setValue, that means you have to know when you code with pattern is block and which one is variable. I would call it PHP code driven. If you define in a different way blocks and variable, then you can make generic code that will list the document blocks and variables, and apply some processing, whatever the document will be. I would call it document driven. Note it can be done by searching closing pattern (variables are blocks without closing pattern), but when you use the same name for a block and a variable (that is to say when you write inside the block a data that is also related to the number of data instance, then this rule begins to be more complicated to implement. |
Another point. For a real word template document processing, the block management order is important to manage complexity. Not separating block and variable means variables are blocks that are not closes. Which means errors in blocks definition (let say 1 letter typing error) means the blocks will be understood as 2 variables...and not as an error. |
Is your feature request related to a problem? Please describe.
In TemplateProcessor.php, the following characters are defined
And are used for:
Then the cloning blocks macro should be replaced by '' if only used to manage blocks.
It is even more annoying if you want to use a variable that is used inside a block to duplicate a block...
Describe the solution you'd like
Allow to define different characters for variables and blocks
Describe alternatives you've considered
No generic way to distinguish between blocks and variable in an automated way, with no assumption in the document
Additional context
My goal is to define the way the template is filled from the template itself, and not from any PHP code.
The text was updated successfully, but these errors were encountered: