mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-03 05:41:37 +01:00
- fixed handling of template_exits methode for all resource types
This commit is contained in:
@@ -21,15 +21,11 @@
|
||||
* @return boolean status
|
||||
*/
|
||||
function template_exists($smarty, $resource_name)
|
||||
{
|
||||
foreach((array)$smarty->template_dir as $_template_dir) {
|
||||
$_filepath = $_template_dir . $resource_name;
|
||||
if (file_exists($_filepath))
|
||||
return true;
|
||||
}
|
||||
if (file_exists($resource_name)) return true;
|
||||
// no tpl file found
|
||||
return false;
|
||||
{
|
||||
// create template object
|
||||
$tpl = new $smarty->template_class($resource_name, $smarty);
|
||||
// check if it does exists
|
||||
return $tpl->isExisting();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user