Added method to check if template file exists.

pull/11/head
Mike Cao 14 years ago
parent d5c696a969
commit 516873fe13

@ -106,11 +106,22 @@ class View {
* Displays escaped output.
*
* @param string $str String to escape
* @return string Escaped string
*/
public function e($str) {
echo htmlentities($str);
}
/**
* Checks if a template file exists.
*
* @param string $file Template file
* @return bool Template file exists
*/
public function exists($file) {
return file_exists($this->path.'/'.((substr($file, -4) == '.php') ? $file : $file.'.php'));
}
/**
* Loads and executes view helper functions.
*

Loading…
Cancel
Save