Skip to content

TemplateLoader

github-actions edited this page Apr 10, 2026 · 2 revisions

Loads license template files from the filesystem.

This class reads license template files from a configured templates directory. The default directory is the packaged resources/licenses folder.


Methods

__construct

Creates a new TemplateLoader instance.

public __construct(string|null $templatesPath = null): mixed

Parameters:

Parameter Type Description
$templatesPath string|null Optional custom path to the templates directory

load

Loads a license template file by its filename.

public load(string $templateFilename): string

Parameters:

Parameter Type Description
$templateFilename string The filename of the template to load (e.g., "mit.txt")

Return Value:

The template content

Throws:

if the template file is not found


Clone this wiki locally