Hi All,
I’m trying to apply a PHP function to a template’s entire contents, and have enabled PHP and set it to parse on output. However it seems an embedded template in the template isn’t processed before PHP parsing occurs. Can someone tell me what I’m doing wrong?
<?php
$input = <<<EETAG
{embed="test/embed"}
EETAG;
echo preg_replace('/embed/','cheese',$input);
?>I assume that ‘parse on output’ should mean the EE tag is expanded (into the content of the test/embed template) *before* preg_replace occurs, but the output I get is “{cheese="test/cheese"}“. If I just echo $input without preg_replace I do get the embedded template’s contents.
Alternatively if I’m doing it wrong can someone reply with pseudo-code to apply a PHP function to a ‘rendered template’?
Thanks in advance
peace - oli