diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2020-07-03 07:30:33 +0100 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2020-07-03 07:35:15 +0100 |
| commit | 6f68916103931ce3f715eba5c6f55acf120c084e (patch) | |
| tree | 06a1828961f44fa73c749e86299469505a040378 /modules_v4 | |
| parent | 49a2c9dc10450a2c87a90ccd44117031df6ab02d (diff) | |
| download | webtrees-6f68916103931ce3f715eba5c6f55acf120c084e.tar.gz webtrees-6f68916103931ce3f715eba5c6f55acf120c084e.tar.bz2 webtrees-6f68916103931ce3f715eba5c6f55acf120c084e.zip | |
Update exampe-footer module
Diffstat (limited to 'modules_v4')
| -rw-r--r-- | modules_v4/example-footer.disable/module.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules_v4/example-footer.disable/module.php b/modules_v4/example-footer.disable/module.php index ca7d0824d5..fc2b35a9ee 100644 --- a/modules_v4/example-footer.disable/module.php +++ b/modules_v4/example-footer.disable/module.php @@ -57,7 +57,13 @@ return new class extends AbstractModule implements ModuleCustomInterface, Module */ public function getFooter(ServerRequestInterface $request): string { - $url = route('module', ['module' => $this->name(), 'action' => 'Page']); + $tree = $request->getAttribute('tree'); + + $url = route('module', [ + 'module' => $this->name(), + 'action' => 'Page', + 'tree' => $tree ? $tree->name() : null, + ]); return view($this->name() . '::footer', ['url' => $url]); } @@ -73,6 +79,7 @@ return new class extends AbstractModule implements ModuleCustomInterface, Module { return $this->viewResponse($this->name() . '::page', [ 'title' => $this->title(), + 'tree' => $request->getAttribute('tree'), ]); } }; |
