本文整理汇总了PHP中yii\web\AssetBundle类的典型用法代码示例。如果您正苦于以下问题:PHP AssetBundle类的具体用法?PHP AssetBundle怎么用?PHP AssetBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AssetBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initView
public function initView($view)
{
$files = [pathinfo('@nitm/assets/js/jquery-plugins/jquery.ui.widget.js'), pathinfo('@nitm/assets/js/jquery-plugins/jquery-ui-scrollable/jquery-ui-scrollable.js')];
foreach ($files as $f) {
$asset = new \yii\web\AssetBundle(['sourcePath' => $f['dirname'], 'js' => [$f['basename']]]);
$asset->publish($view->getAssetManager());
$view->assetBundles[static::className() . '\\' . $f['basename']] = $asset;
}
return $this;
}
示例2: init
/**
* Initialize the widget.
*
* If YII_ENV_DEV is defined, the not minified version of the css and the js files
* are used.
* @see \yii\web\AssetBundle::init()
*/
public function init()
{
$this->sourcePath = __DIR__ . '/assets';
$this->js = ['js/pnotify.custom' . (YII_ENV_DEV ? '.js' : '.min.js')];
$this->css = ['css/pnotify.custom' . (YII_ENV_DEV ? '.css' : '.min.css')];
return parent::init();
}
示例3: init
/**
* @inheritdoc
*/
public function init()
{
$this->setSourcePath('@vendor/branchonline/yii2-select2/assets/select2');
$this->setupAssets('css', ['select2']);
$this->setupAssets('js', ['select2.min']);
parent::init();
}
示例4: init
public function init()
{
parent::init();
if (!file_exists(\Yii::getAlias('@bower/sticky/jquery.sticky.js'))) {
throw new InvalidConfigException('You must include `bower-asset/sticky` package in your composer.json configuration file.');
}
}
示例5: init
public function init()
{
parent::init();
if ($this->sourcePath == null) {
$this->sourcePath = __DIR__ . DIRECTORY_SEPARATOR . 'assets';
}
}
示例6: init
public function init()
{
if (empty($this->js)) {
$this->js = $this->getJs();
}
return parent::init();
}
示例7: init
public function init()
{
parent::init();
$this->sourcePath = __DIR__ . DIRECTORY_SEPARATOR . 'source';
$this->depends[] = JqueryAsset::className();
$this->depends[] = BootstrapThemeAsset::className();
}
示例8: registerAssetFiles
public function registerAssetFiles($view)
{
$nodigitLib = preg_replace('/[0-9]+/', '', $this->library);
$this->js[] = $this->library . '-editable/js/' . $nodigitLib . '-editable' . (YII_DEBUG ? '.js' : '.min.js');
$this->css[] = $this->library . '-editable/css/' . $nodigitLib . '-editable.css';
parent::registerAssetFiles($view);
}
示例9: init
/**
* @inheritdoc
*/
public function init()
{
$postfix = YII_DEBUG ? '' : '.min';
$this->css[] = 'summernote.css';
$this->js[] = 'summernote' . $postfix . '.js';
parent::init();
}
示例10: init
public function init()
{
// pr(Yii::$app->view->theme->selectedTheme);die;
// $this->js = $this->_populateFiles('js');
// $this->css = $this->_populateFiles('css');
parent::init();
}
示例11: init
public function init()
{
if (!empty($this->js) && $this->enableLocale && ($language = $this->getLanguage()) !== null) {
$this->js[] = 'js/locales/bootstrap-datepicker.' . $language . '.min.js';
}
parent::init();
}
示例12: init
/**
* @inheritdoc
*/
public function init()
{
$postfix = YII_DEBUG ? '' : '.min';
$this->js[] = 'jstree' . $postfix . '.js';
$this->css[] = 'themes/default/style' . $postfix . '.css';
parent::init();
}
示例13: registerAssetFiles
/**
* Register language script.
*/
public function registerAssetFiles($view)
{
if ($this->language) {
$this->js[] = 'locale/bootstrap-markdown.' . $this->language . '.js';
}
parent::registerAssetFiles($view);
}
示例14: init
public function init()
{
$this->js[] = 'ckeditor.js';
//?v=' . microtime();
$this->js[] = 'ckeditor.sample.init.js?v=' . microtime();
parent::init();
}
示例15: init
public function init()
{
parent::init();
$this->sourcePath = __DIR__ . '/assets';
$this->setupAssets('css', ['css/blockmodels']);
$this->setupAssets('js', ['js/blockmodels']);
}