Is there a method that can parse the template to predict the keys it uses?
E.g. in this case such a function would return.
['msg-foo', 'x']
My use cases are
1) throw an error when certain variables are passed to the template renderer e.g. if i dont pass a key foo to the template it should throw an error
2) i want to programmatically define template variables. For example any template key prefixed with msg- would be substituted beforehand e.g.
$templateData =[];
foreach($keysPrefixedWithMsg as $key){
$templateData[$key] = generateDataValue($key):
}
This is possibly a feature request but hopefully it's already possible.
Given a template
Is there a method that can parse the template to predict the keys it uses?
E.g. in this case such a function would return.
My use cases are 1) throw an error when certain variables are passed to the template renderer e.g. if i dont pass a key foo to the template it should throw an error 2) i want to programmatically define template variables. For example any template key prefixed with
msg-
would be substituted beforehand e.g.Let me know if I am not explaining well!
Thanks in advance!