Open sevrugin opened 3 months ago
Hello,
The default behavior is throw an error if the variable doesn't exist.
However you can change this by using any of the UndefinedInterface
implementation or by creating your own.
The UndefinedInterface
is called everytime a variable is undefined.
$template = new Template($templateString);
$template->withUndefined(new DefaultUndefined()); // For each variable doens't exists it will replace by `' ' ` an empty string.
Hi Found one issue with my template
It happens if I'm using {{ for item in array }}, but I don't have an "array" value in data Is it possible to just ignore not existing variables?