AdminAsset.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. 'css/bootstrap-glyphicons.min.css'
  17. ];
  18. public $js = [
  19. 'ckeditor/ckeditor.js',
  20. 'js/admin.js',
  21. '/js/chart.min.js',
  22. '/js/widget2chart.js',
  23. '/js/ifvisible.min.js',
  24. 'jquery-cropper/cropper.min.js',
  25. 'jquery-cropper/jquery-cropper.min.js',
  26. 'js/tags.js'
  27. ];
  28. public $depends = [
  29. 'yii\web\YiiAsset',
  30. 'yii\jui\JuiAsset'
  31. ];
  32. public $jsOptions = [
  33. 'position' => View::POS_HEAD
  34. ];
  35. public function init()
  36. {
  37. parent::init();
  38. // resetting BootstrapAsset to not load own css files
  39. \Yii::$app->assetManager->bundles['yii\\bootstrap\\BootstrapAsset'] = [
  40. 'css' => [],
  41. 'js' => []
  42. ];
  43. \Yii::$app->assetManager->bundles['yii\\web\\JqueryAsset'] = [
  44. 'css' => [],
  45. 'js' => []
  46. ];
  47. \Yii::$app->assetManager->bundles['yii\\jui\\JuiAsset'] = [
  48. 'js' => ['jquery-ui.min.js']
  49. ];
  50. \Yii::$app->assetManager->bundles['yii\\web\\YiiAsset'] = [
  51. 'jsOptions' => []
  52. ];
  53. }
  54. }