Just like $_['alert'] to pre-create Alert::{$type}() invocation, we likely will need $_['asset'] property too, to manage the control panel assets, so that we don’t have to check if we are in a valid control panel route before invoking any Asset::{$type}() on every panel-related extensions.
The default value should be the front-end asset data converted into array, but with skip property that has been set to true:
$_['asset'] = [
'.\lot\layout\asset\index.css' => [
'skip' => true,
'stack' => 20
],
// ...
];
// If `link` or `url` or `path` property exists, then
// the array key will become an `id` attribute, unless
// a `2['id']` or `id` property exists in the asset item.
$_['asset'] = [
'asset-0' => [
'path' => '.\lot\layout\css\index.css',
'stack' => 20
],
'asset-1' => [
'2' => [
'class' => 'custom-class',
'id' => 'custom-id'
],
'path' => '.\lot\layout\css\index.css',
'stack' => 20
],
// ...
];
// Example embedded `<style>` tag
$_['asset']['style'] = [
'foo-bar' => [
'content' => ':root{--width:600px}',
'skip' => true,
'stack' => 20
],
// ...
];
So that any front-end assets will not be loaded into the page. Developers may force the excluded front-end assets to be included in the control panel by removing the skip property or by simply set the skip property value to false:
// Include front-end asset to the control panel
$_['asset']['.\lot\layout\asset\css\index.css']['skip'] = false;
// Make sure to load the asset in the last
$_['asset']['.\lot\layout\asset\css\index.css']['stack'] = 9999;
This is useful for a theme developer who want to make both front-end and back-end appearance to look exactly the same.
Just like
$_['alert']
to pre-createAlert::{$type}()
invocation, we likely will need$_['asset']
property too, to manage the control panel assets, so that we don’t have to check if we are in a valid control panel route before invoking anyAsset::{$type}()
on every panel-related extensions.The default value should be the front-end asset data converted into array, but with
skip
property that has been set totrue
:So that any front-end assets will not be loaded into the page. Developers may force the excluded front-end assets to be included in the control panel by removing the
skip
property or by simply set theskip
property value tofalse
:This is useful for a theme developer who want to make both front-end and back-end appearance to look exactly the same.