In a templating system I'm working on, I have a block which I would like to setup like this:
with each one on a new line. However I can't get that to work. I have to do:
This appears to be because it doesnt like \n's before the .+ The regular expressions I'm using to parse this are:
and also
Any suggestions on how to do what I want to do?
PHP Code:
{block:time}
the time is {$time}
{/block}
PHP Code:
{block:time}The time is: {$time}
{/block}
PHP Code:
preg_match_all('/{block:'.$name.'}(\n*.+\n*){\/block}/m', $this->template, $blocks);
PHP Code:
$template = preg_replace('/{block:'.$block.'}\\n*.+\\n*{\/block}/m',
$this->blocks["$block"], $template);
Comment