class Templater
{
public function get($name)
{
//try
//{
$tpl = file_get_contents("tpls/tpl-{$name}.tpl");
//throw new Exception("Шаблон <em><b>{$name}</b></em> не найден.<br/>");
//} catch (Exception $e)
//{
//return $e->getMessage();
//}
return $tpl;
}
}
Так грузит нормально. А при разкомментированном try-catch вылетает исключение. Так и должно быть? Ставить throw в
if ($tpl = file_get_contents)
{
throw…
}