I came up with to add a simple template encoder. It will take the normalized data as array and use the array keys to insert the values in the template.
Usecase
<?php
$encoder = new TemplateTextEncoder();
$encoder->setDelimiter('%');
$encoder->setTemplate("Subject: %subject%" . PHP_EOL . "Message: %message%");
$encoder->encode(array('subject' => 'Server crashed', 'message' => 'Something unexpected happened'), 'template-text');
@makasim what do you think about the idea?
I came up with to add a simple template encoder. It will take the normalized data as array and use the array keys to insert the values in the template.
Usecase
@makasim what do you think about the idea?