Example #1
0
 public function init()
 {
     parent::init();
     if (!isset($this->clientOptions['styling'])) {
         $this->clientOptions['styling'] = 'bootstrap3';
     }
 }
Example #2
0
 public function run()
 {
     $flashes = Yii::$app->getSession()->getAllFlashes();
     $notifications = [];
     foreach ($flashes as $type => $data) {
         if (isset($this->alertTypes[$type])) {
             $data = (array) $data;
             foreach ($data as $message) {
                 $message = $this->normalizeMessage($message);
                 $notifications[] = ArrayHelper::merge(['type' => $type], $message);
             }
             Yii::$app->getSession()->removeFlash($type);
         }
     }
     echo PNotify::widget(['notifications' => $notifications]);
 }