Skip to content

Commit

Permalink
Merge pull request #71 from manuscle/master
Browse files Browse the repository at this point in the history
adding hasMessage into FlashMessenger
  • Loading branch information
RWOverdijk committed Jul 18, 2013
2 parents b33a77d + 4ff2637 commit 0eaa585
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/SxBootstrap/View/Helper/Bootstrap/FlashMessenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,19 @@ public function __invoke($namespace = null, $isBlock = true)
return clone $this;
}

/**
* @return bool
*/
public function hasMessages()
{
$namespaces = !is_null($this->namespaces) ? $this->namespaces : $this->availableNamespaces;

foreach ($namespaces as $namespace) {
if (0 < count($this->getView()->plugin('flash_messenger')->__invoke($namespace))) {
return true;
}
}

return false;
}
}

0 comments on commit 0eaa585

Please sign in to comment.