{"action":"closed","issue":{"url":"https://api.github.com/repos/Shifrin/yii2-noty/issues/5","repository_url":"https://api.github.com/repos/Shifrin/yii2-noty","labels_url":"https://api.github.com/repos/Shifrin/yii2-noty/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/Shifrin/yii2-noty/issues/5/comments","events_url":"https://api.github.com/repos/Shifrin/yii2-noty/issues/5/events","html_url":"https://github.com/Shifrin/yii2-noty/issues/5","id":134500734,"number":5,"title":"Session Flash","user":{"login":"hendrasyp","id":15682267,"avatar_url":"https://avatars.githubusercontent.com/u/15682267?v=3","gravatar_id":"","url":"https://api.github.com/users/hendrasyp","html_url":"https://github.com/hendrasyp","followers_url":"https://api.github.com/users/hendrasyp/followers","following_url":"https://api.github.com/users/hendrasyp/following{/other_user}","gists_url":"https://api.github.com/users/hendrasyp/gists{/gist_id}","starred_url":"https://api.github.com/users/hendrasyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hendrasyp/subscriptions","organizations_url":"https://api.github.com/users/hendrasyp/orgs","repos_url":"https://api.github.com/users/hendrasyp/repos","events_url":"https://api.github.com/users/hendrasyp/events{/privacy}","received_events_url":"https://api.github.com/users/hendrasyp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Shifrin/yii2-noty/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-18T07:22:12Z","updated_at":"2016-02-21T07:03:39Z","closed_at":"2016-02-21T07:03:39Z","body":"Thanks for this useful widget.\r\n\r\nHow to disable flash on ```enableSessionFlash``` ? . If I set to ```false``` , return me error ```undefine variable $view``` .\r\n\r\nso I make changes in NotyWidget.php : \r\n```\r\npublic function run()\r\n{\r\n  $this->registerAssets();\r\n  $this->registerPlugin();\r\n  $view = $this->getView();\r\n  $script = \"\";\r\n  if ($this->enableSessionFlash) \r\n  {\r\n    $flashes = Yii::$app->session->getAllFlashes();\r\n    foreach($flashes as $type => $message) \r\n    {\r\n      if (empty($message))\r\n      {\r\n          continue;\r\n      }\r\n      $type = $this->verifyType($type);\r\n      $icon = $this->getIcon($type);\r\n      $text = is_array($message) ? $icon . implode(' ', $message) : $icon . $message;\r\n      $script .= \"var {$type} = Noty('{$this->getId()}');\\r\\n\";\r\n      $script .= \"$.noty.setText({$type}.options.id, '{$text}');\\r\\n\";\r\n      $script .= \"$.noty.setType({$type}.options.id, '{$type}');\\r\\n\";\r\n    }\r\n  }else{\r\n      $view = $this->getView();\r\n  }\r\n  $view->registerJs($script);\r\n}\r\n```\r\n"}}