-
-
Save kurtpayne/ec35af03594246c6dd52 to your computer and use it in GitHub Desktop.
Override prepareTemplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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