I have this tag into my html file:
{{block:my_test_block}}
{{news:my_test_block2}}
I need to parse and replace this tag with content from db, my aproach:
ob_start();
require_once('file.php');
$template = ob_get_contents();
ob_end_clean();
$line = preg_replace_callback('/{(\w+)}/' , "parseTag" , $template);
function parseTag($matches){
//here switch for block, news,
}
is it the right way? Thanks.