mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
add prefilter
This commit is contained in:
@@ -557,6 +557,20 @@ KEY `expire` (`expire`)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* prefilter to insert test number
|
||||||
|
*
|
||||||
|
* @param string $source
|
||||||
|
* @param \Smarty_Internal_Template $tpl
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function prefilterTest($source, Smarty_Internal_Template $tpl)
|
||||||
|
{
|
||||||
|
return str_replace('#test#', "test:{\$test nocache} compiled:{$tpl->getTemplateVars('test')} rendered:{\$test}",
|
||||||
|
$source);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tears down the fixture
|
* Tears down the fixture
|
||||||
* This method is called after a test is executed.
|
* This method is called after a test is executed.
|
||||||
|
Reference in New Issue
Block a user