update plugi
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user