update plugi

This commit is contained in:
Paul Spenke
2023-06-29 11:31:43 +08:00
parent 47d62be82c
commit 706315cd34
9 changed files with 87 additions and 15 deletions
+27
View File
@@ -42,6 +42,15 @@ class Extensions
'admin-footer' => [],
];
protected static $htmlBlocks = [
'head-end' => [],
'body-start' => [],
'body-end' => [],
'admin-head-end' => [],
'admin-body-start' => [],
'admin-body-end' => [],
];
/**
* Register an asset.
* @param string $src
@@ -57,6 +66,17 @@ class Extensions
];
}
/**
* Register an HtmlBlock.
* @param string $html
* @param string $location
*/
public static function registerHtmlBlock(string $html, string $location = 'head-end') {
self::$assets[$location][] = [
'html' => $html,
];
}
/**
* Register a single extension-config.
* @param string $slug
@@ -222,6 +242,13 @@ class Extensions
return self::$layouts[$id] ?? null;
}
/**
* Get all header assets.
*/
public static function getHtmlBlocks(string $location = 'head-end') {
return implode('', self::$htmlBlocks[$location]);
}
/**
* Get all header assets.
*/