Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =====================================================================
- ShareAsset.php <= this is located inside "{module}/assets/" directory
- =====================================================================
- <?php
- namespace core\modules\share\assets;
- use yii\web\AssetBundle;
- class ShareAsset extends AssetBundle
- {
- public $sourcePath = '@core/modules/share/views/share';
- public $css = [
- 'css/share.css',
- 'css/vendor/stepper.css',
- 'css/vendor/bootstrap-select.css'
- ];
- public $js = [
- 'js/share.js',
- 'js/vendor/stepper.js',
- 'js/vendor/bootstrap-select.min.js',
- '@vendor/almasaeed2010/adminlte/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js'
- ];
- public $depends = [
- 'yii\web\YiiAsset',
- 'yii\bootstrap\BootstrapAsset',
- ];
- public function init()
- {
- $this->publishOptions['forceCopy'] = true;
- }
- }
- ==========================================================
- Share.php <= This is located inside the root of my module
- ==========================================================
- <?php
- namespace core\modules\share;
- use Yii;
- use core\modules\share\assets\ShareAsset;
- /**
- * share module definition class
- */
- class Share extends \yii\base\Module
- {
- /**
- * {@inheritdoc}
- */
- public $controllerNamespace = 'core\modules\share\controllers';
- /**
- * {@inheritdoc}
- */
- public function init()
- {
- parent::init();
- ShareAsset::register(Yii::$app->view);
- // custom initialization code goes here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement