public function init() { parent::init(); if (!isset($this->clientOptions['styling'])) { $this->clientOptions['styling'] = 'bootstrap3'; } }
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]); }