AdminAsset.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\modules\manager\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. }