AdminAsset.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\modules\control\assets;
  3. use yii\web\AssetBundle;
  4. use yii\web\View;
  5. class AdminAsset extends AssetBundle
  6. {
  7. public $sourcePath = '@app/web/components/admin';
  8. public $basePath = '@webroot/components/admin';
  9. public $baseUrl = '@web/components/admin';
  10. public $css = [
  11. 'css/style.css',
  12. 'css/tags.css',
  13. 'ckeditor/contents.css',
  14. '/css/site.min.css',
  15. 'jquery-cropper/cropper.min.css'
  16. ];
  17. public $js = [
  18. 'ckeditor/ckeditor.js',
  19. 'js/admin.js',
  20. '/js/chart.min.js',
  21. '/js/widget2chart.js',
  22. '/js/ifvisible.min.js',
  23. 'jquery-cropper/cropper.min.js',
  24. 'jquery-cropper/jquery-cropper.min.js',
  25. 'js/tags.js'
  26. ];
  27. public $depends = [
  28. 'yii\web\YiiAsset',
  29. 'yii\jui\JuiAsset'
  30. ];
  31. public $jsOptions = [
  32. 'position' => View::POS_HEAD
  33. ];
  34. public function init()
  35. {
  36. parent::init();
  37. // resetting BootstrapAsset to not load own css files
  38. \Yii::$app->assetManager->bundles['yii\\bootstrap\\BootstrapAsset'] = [
  39. 'css' => [],
  40. 'js' => []
  41. ];
  42. \Yii::$app->assetManager->bundles['yii\\web\\JqueryAsset'] = [
  43. 'css' => [],
  44. 'js' => []
  45. ];
  46. \Yii::$app->assetManager->bundles['yii\\jui\\JuiAsset'] = [
  47. 'js' => ['jquery-ui.min.js']
  48. ];
  49. \Yii::$app->assetManager->bundles['yii\\web\\YiiAsset'] = [
  50. 'jsOptions' => []
  51. ];
  52. }
  53. }