+ /**
+ * Initializes the template engine
+ *
+ * @param $templateType Type of template, e.g. 'html', 'image', 'console' ...
+ * @return void
+ * @throws InvalidArgumentException If a parameter has an invalid value
+ */
+ public final function initTemplateEngine (string $templateType) {
+ // Check paramter
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-COMMAND: templateType=%s - CALLED!', $templateType));
+ if (empty($templateType)) {
+ // Throw IAE
+ throw new InvalidArgumentException('Parameter "templateType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+ }
+
+ // Prepare a template instance
+ $templateInstance = ObjectFactory::createObjectByConfiguredName(sprintf('%s_template_class', $templateType));
+
+ // Set it here
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-COMMAND: templateInstance=%s', $templateInstance->__toString()));
+ $this->setTemplateInstance($templateInstance);
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-COMMAND: EXIT!');
+ }
+