ranlt / smarty-php

Automatically exported from code.google.com/p/smarty-php
0 stars 0 forks source link

add try catch inside templateExists #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. $tpl_exists=$smarty->templateExists(NULL)

What is the expected output? What do you see instead?
I want false to be returned, but instead I received a SmartyException saying 
"Missing template name",from 
        Smarty_Internal_Template->__get('resource')
when doing
        // check if it does exists
        $result = $tpl->source->exists;

And as I think, it's not necessary for method like this to raise an exception 
because of an empty template name;

What version of the product are you using? On what operating system?
using smarty 3.1.16

Original issue reported on code.google.com by hkucl...@gmail.com on 1 Apr 2014 at 6:14

GoogleCodeExporter commented 9 years ago
I don't agree that this is a bug. The method templateExists() does require a 
specification of a template. If this is not done it's a bug in the application 
and should throw an error. what should be the sense to call 
$smarty->templateExists(NULL)?

Original comment by Uwe.Tews@googlemail.com on 1 Apr 2014 at 9:13