Default parent template to "index" and added sanity check if template exists.

This commit is contained in:
Josh Sherman 2010-11-12 23:03:18 -05:00
parent 20b0d55839
commit d64251c098
2 changed files with 5 additions and 2 deletions

View file

@ -123,7 +123,10 @@ abstract class Display_Common extends Object
$template_path = SITE_TEMPLATE_PATH . ($type == 'parent' ? '__shared/' : '');
$template_file = $template_path . $template . ($this->extension != false ? '.' . $this->extension : '');
$this->$template_name = $template_file;
if (file_exists($template_file))
{
$this->$template_name = $template_file;
}
}
}