summaryrefslogtreecommitdiff
path: root/modules_v4
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-11-21 23:03:56 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-11-21 23:07:28 +0000
commit915db8c48659f56625569bc7989799a928114d5a (patch)
tree1ea6e141999b5c88c6a60f9c6749d89cd3376623 /modules_v4
parentae194cb814a2c7405f6610bbb8a893d2bcfc1f86 (diff)
downloadwebtrees-915db8c48659f56625569bc7989799a928114d5a.tar.gz
webtrees-915db8c48659f56625569bc7989799a928114d5a.tar.bz2
webtrees-915db8c48659f56625569bc7989799a928114d5a.zip
Update documentation for custom modules
Diffstat (limited to 'modules_v4')
-rw-r--r--modules_v4/example-server-configuration.disable/module.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules_v4/example-server-configuration.disable/module.php b/modules_v4/example-server-configuration.disable/module.php
index 1e21e33a0e..1442354391 100644
--- a/modules_v4/example-server-configuration.disable/module.php
+++ b/modules_v4/example-server-configuration.disable/module.php
@@ -8,6 +8,12 @@ declare(strict_types=1);
namespace MyCustomNamespace;
+// Unlike the other examples, this one has a separate file for the class definition.
+// This is because the constructor has some dependencies, so we must create it
+// with "app(CustomModule::class)" rather than "new CustomModule()".
+// This means we can't use an anonymous class, and our coding standards
+// mean that the class needs to go in its own file.
+// For simple modules, it might be easier to declare the class here.
require __DIR__ . '/ExampleServerConfigurationModule.php';
return app(ExampleServerConfigurationModule::class);