Skip to content

Instantly share code, notes, and snippets.

@kurtpayne

kurtpayne/testCase.php Secret

Created Jul 2, 2012
Embed
What would you like to do?
Override prepareTemplate
<?php
/**
* 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.