Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You can redefine the component in the config, it's done like this:
'assetManager' => [
'bundles' => [
'some\namespace\SomeAsset' => [
'sourcePath' => '@web/myassets/folder', // redeclare default folder
'css' => [
'my_widget_style.css',
'other_style.css',
],
'js' => [
],
'depends' => [
],
],
],
],
Good morning.
Everything is simple.
Create an assets directory in the widget directory, add css files there and create your WidgetAssets (inherited from AssetBundle) where you write resource files.
The structure is as follows:
The contents of the SwitchThemesAsset.php file
class SwitchThemesAsset extends AssetBundle
{
public $css = [
'css/switchthemes.css'
];
public function init()
{
$this->sourcePath = __DIR__.'/assets';
parent::init();
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question