Skip to content

Commit 2061c40

Browse files
committed
Presenter::sendTemplate() added parameter $template
1 parent dd5b590 commit 2061c40

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Application/UI/Presenter.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,7 @@ public function run(Application\Request $request): Application\IResponse
242242
}
243243

244244
// finish template rendering
245-
if ($this->getTemplate()) {
246-
$this->sendTemplate();
247-
}
245+
$this->sendTemplate();
248246

249247
} catch (Application\AbortException $e) {
250248
}
@@ -445,12 +443,11 @@ public function setLayout($layout)
445443

446444

447445
/**
448-
* @throws Nette\Application\BadRequestException if no template found
449446
* @throws Nette\Application\AbortException
450447
*/
451-
public function sendTemplate(): void
448+
public function sendTemplate(ITemplate $template = null): void
452449
{
453-
$template = $this->getTemplate();
450+
$template = $template ?? $this->getTemplate();
454451
if (!$template->getFile()) {
455452
$files = $this->formatTemplateFiles();
456453
foreach ($files as $file) {

0 commit comments

Comments
 (0)