Open ghost opened 10 years ago
I just fixed it for my project, Here is my solution:
protected function _check_template( $template ){ // set filename $template_name = basename( $template );
$template_basedir = dirname($template)== '.' ?null: dirname($template) . '/';
$template_directory = (strpos($template,"//")=== false&&strpos($template,":\\")=== false)?static::$conf['tpl_dir'] . $template_basedir:$template_basedir;
$template_filepath = $template_directory . $template_name . '.' . static::$conf['tpl_ext'];
$parsed_template_filepath = static::$conf['cache_dir'] . $template_name . "." . md5( $template_directory . serialize( static::$conf['checksum'] ) ) . '.rtpl.php';
// if the template doesn't exsist throw an error
if( !file_exists( $template_filepath ) ){
$e = new RainTpl_NotFoundException( 'Template '. $template_name .' not found!' );
throw $e->setTemplateFile($template_filepath);
}
// Compile the template if the original has been updated
if( static::$conf['debug'] || !file_exists( $parsed_template_filepath ) || ( filemtime($parsed_template_filepath) < filemtime( $template_filepath ) ) )
$this->_compile_file( $template_name, $template_basedir, $template_filepath, $parsed_template_filepath );
return $parsed_template_filepath;
}
I can't load a template in a subfolder.
When I use this:
It does this
but when changing to
then it works.. but how can I let it work with forward slashes