feat(template): fix incorrect if condition
This commit is contained in:
parent
2919e70d05
commit
e6e0baab12
|
@ -22,7 +22,7 @@ class Template extends View
|
||||||
*/
|
*/
|
||||||
public static function fromFile(string $path): self
|
public static function fromFile(string $path): self
|
||||||
{
|
{
|
||||||
if (\is_readable($path)) {
|
if (!\is_readable($path)) {
|
||||||
throw new Exception("$path view template is not readable.");
|
throw new Exception("$path view template is not readable.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class Template extends View
|
||||||
if (empty($html)) {
|
if (empty($html)) {
|
||||||
throw new Exception('Empty HTML string');
|
throw new Exception('Empty HTML string');
|
||||||
}
|
}
|
||||||
|
|
||||||
$template = new Template();
|
$template = new Template();
|
||||||
return $template->setHtml($html);
|
return $template->setHtml($html);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue