/**
  * Register js initialization script.
  */
 public function registerClientScript()
 {
     $view = $this->getView();
     PNotifyAsset::register($view);
     $options = empty($this->pluginOptions) ? '' : Json::encode($this->pluginOptions);
     $js = "new PNotify(" . $options . ");";
     $view->registerJs($js);
 }
Exemple #2
0
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\helpers\VarDumper;
use yii\helpers\Url;
use yii\web\view;
use yii\web\JsExpression;
use yiidreamteam\jstree\JsTree;
use raoul2000\widget\pnotify\PNotifyAsset;
use yii2mod\alert\AlertAsset;
use kartik\select2\Select2;
use kartik\select2\ThemeDefaultAsset;
$this->title = 'Recipe Editor';
$this->params['breadcrumbs'][] = $this->title;
PNotifyAsset::register($this);
// load js for PNotify
AlertAsset::register($this);
// load for sweetalert
ThemeDefaultAsset::register($this);
// load this so that we can register another CSS for use AFTER this
// Register the tree-edit css, this has to be done after the select2 theme is loaded, and in this case
// we are using the default theme for the component. This all breaks if the theme is changed and
// that asset must be manually loaded for this to keep the tree css file at the end of the list
// need something like an option to say put to last...
$this->registerCssFile('@web/css/tree-edit.css', ['depends' => ['kartik\\select2\\Select2Asset']]);
//var_dump($this->getAssetManager()->bundles);
//var_dump(\kartik\select2\ThemeDefaultAsset::className());
?>