From 3a95d8531054acebf6355c42f6230eb422f36e4e Mon Sep 17 00:00:00 2001 From: Ian Wilson Date: Mon, 29 Jul 2024 22:25:57 +0100 Subject: [PATCH] more docs for module base2 --- content/dev/modules/base/_index.md | 36 ++++++++++++++++++++++ content/dev/modules/base/logging/_index.md | 4 +-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/content/dev/modules/base/_index.md b/content/dev/modules/base/_index.md index 4b20923cf..0161934fa 100644 --- a/content/dev/modules/base/_index.md +++ b/content/dev/modules/base/_index.md @@ -59,14 +59,50 @@ There are also a number of helper methods to get some of the most common module ### getTitle +This gets the title for the Module. + +It looks for defines with suffixes in an array of ['TITLE', 'TEXT_TITLE', 'CATALOG_TITLE'] + +If your module uses a different define for the title then you should override the getTitle method. + ### getAdminTitle +This returns a title to display on the Admin interface. In general this would be the same as the getTitle as above, but sometimes you may want it to be different. +It expects to be passed a default title, which would normally be what the getTitle function returns, ans will use this if it does not find a define related to the admin title. + +This function looks for defines with a suffix in an array ['TITLE_ADMIN', 'TEXT_TITLE_ADMIN', 'ADMIN_TITLE'] + +If your admin title is defined through other means, them you will need to override this method in your module. + ### getDescription +returns a module define with the suffix `DESCRIPTION` + ### getSortOrder +returns a module define with the suffix `SORT_ORDER` + ### getZone +returns a module define with the suffix `ZONE` + +### getDebugMode# + +returns a module define with the suffix `DEBUG_MODE` + +### isEnabled + +This function checks to see if the module is enabled. + +it first checks to see if the module has any missing configuraitions and then check the module define suffix `STATUS` + +### moduleAutoloadSupportClasses + +This function is only called if it exists. + +It allows a module to add autoload classes using the psr4autoaload Aura autoload. + + diff --git a/content/dev/modules/base/logging/_index.md b/content/dev/modules/base/logging/_index.md index 87680bb3f..37d43d517 100644 --- a/content/dev/modules/base/logging/_index.md +++ b/content/dev/modules/base/logging/_index.md @@ -21,7 +21,7 @@ It provides 3 log handlers - Console logging - Email Logging -To log an something in a module you can do +To log something in a module you can do `$this->logger->log($logLevel, $message, $context)` @@ -82,7 +82,7 @@ Then if a customer id is available in the context of the log then the customer i ## Console Logging -This will log the error message and context(if passed) to the javasript console. +This will log the error message and context(if passed) to the javascript console. So will be viewable using your browsers developer console.