Template - viames/pair GitHub Wiki
Pair framework: Template
Pair\Models\Template manages installed application templates/themes as package records.
Main methods
getDefault(): ?TemplategetByName(string $name): ?TemplategetPath()getPackageBaseFolder(): stringgetStyleFile(string $styleName): stringgetInstallablePackage(): InstallablePackagepackageRecordExists(string $name): boolsetBase(string $templateName): voidstoreFromPackageManifest(SimpleXMLElement $options): bool
Lifecycle hook:
beforeDelete()removes the template package folder.
Implementation example
$template = \Pair\Models\Template::getDefault();
$styleFile = $template->getStyleFile('default');
\Pair\Html\TemplateRenderer::parse($styleFile);
Switch base template for derived template:
$template->setBase('default');
See also: TemplateRenderer, InstallablePackage, Application.