IframeAsset.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace backend\assets;
  3. use yii\base\Exception;
  4. use yii\web\AssetBundle;
  5. class IframeAsset extends AssetBundle
  6. {
  7. public $sourcePath = '@backend/static';
  8. public $css = [
  9. 'css/AdminLTE.min.css',
  10. 'css/iframe.css'
  11. ];
  12. public $js = [
  13. 'js/app.js',
  14. 'plugins/slimScroll/jquery.slimscroll.min.js',
  15. 'js/iframe.js',
  16. ];
  17. public $depends = [
  18. 'yii\web\YiiAsset',
  19. 'yii\bootstrap\BootstrapAsset',
  20. 'yii\bootstrap\BootstrapPluginAsset',
  21. 'common\assets\FontAwesomeAsset',
  22. ];
  23. /**
  24. * @var string|bool Choose skin color, eg. `'skin-blue'` or set `false` to disable skin loading
  25. * @see https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#layout
  26. */
  27. public $skin = '_all-skins';
  28. /**
  29. * @inheritdoc
  30. */
  31. public function init()
  32. {
  33. // Append skin color file if specified
  34. if ($this->skin) {
  35. if (('_all-skins' !== $this->skin) && (strpos($this->skin, 'skin-') !== 0)) {
  36. throw new Exception('Invalid skin specified');
  37. }
  38. $this->css[] = sprintf('css/skins/%s.min.css', $this->skin);
  39. }
  40. parent::init();
  41. }
  42. }