Skip to content

Instantly share code, notes, and snippets.


kurtpayne/testCase.php Secret

Created Jul 2, 2012
What would you like to do?
Override prepareTemplate
* Define constants after requires/includes
* @param Text_Template $template
* @return void
public function prepareTemplate( Text_Template $template ) {
$property = new ReflectionProperty( $template, 'template' );
$property->setAccessible( true );
$str = $property->getValue( $template );
$str = str_replace( '{constants}', '', $str );
$str .= "\n{constants}\n";
$property->setValue( $template, $str );
parent::prepareTemplate( $template );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.