You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toto je základní metoda loaderu. Jejím úkolem je získat a vrátit úplný zdrojový kód šablony identifikované pomocí `$name` (jak je předáno metodě `$latte->render()` nebo vráceno metodou [#getReferredName()]).
107
107
108
-
Pokud šablonu nelze najít nebo k ní přistupovat, tato metoda **musí vyhodit výjimku `Latte\RuntimeException`**.
108
+
Pokud šablonu nelze najít nebo k ní přistupovat, tato metoda **musí vyhodit výjimku `Latte\TemplateNotFoundException`**.
109
109
110
110
```php
111
111
public function getContent(string $name): string
@@ -169,7 +169,7 @@ class DatabaseLoader implements Latte\Loader
169
169
$stmt->execute([$name]);
170
170
$content = $stmt->fetchColumn();
171
171
if ($content === false) {
172
-
throw new Latte\RuntimeException("Template '$name' not found in database.");
172
+
throw new Latte\TemplateNotFoundException("Template '$name' not found in database.");
This is the core method of the loader. Its task is to retrieve and return the full source code of the template identified by `$name` (as passed to the `$latte->render()` method or returned by the [#getReferredName()] method).
107
107
108
-
If the template cannot be found or accessed, this method **must throw a `Latte\RuntimeException`**.
108
+
If the template cannot be found or accessed, this method **must throw an `Latte\TemplateNotFoundException`**.
109
109
110
110
```php
111
111
public function getContent(string $name): string
@@ -169,7 +169,7 @@ class DatabaseLoader implements Latte\Loader
169
169
$stmt->execute([$name]);
170
170
$content = $stmt->fetchColumn();
171
171
if ($content === false) {
172
-
throw new Latte\RuntimeException("Template '$name' not found in database.");
172
+
throw new Latte\TemplateNotFoundException("Template '$name' not found in database.");
0 commit comments