src/BackendIntegration/TemplateList.php
private function fetchTemplatesFromResourceDirectories($templateBaseName)
    {
        $allTemplates = [];
        $themeName    = $this->getNoThemeMessage();
        // Add the module templates folders if they exist.
        foreach ($this->resourceDirs as $resourceDir) {
            $allTemplates = array_replace_recursive(
                $allTemplates,
                $this->getTemplatesForBaseFrom($templateBaseName, $resourceDir . '/templates', $themeName)
            );
        }

        return $allTemplates;
    }
private function fetchTemplatesFromResourceDirectories($templateBaseName)
    {
        $allTemplates = [];
        $themeName    = $this->getNoThemeMessage();
        // Add the module templates folders if they exist.
        foreach ($this->resourceDirs as $resourceDir) {
            $allTemplates = array_replace_recursive(
                $allTemplates,
                $this->getTemplatesForBaseFrom($templateBaseName, $resourceDir . '/templates', $themeName)
            );
        }

        return $allTemplates;
    }
Fetch the templates from resource locations.

@param string $templateBaseName The base name for the templates to retrieve.

@return array