ZF-7150: Method to get all used namespaces
Description
In my case, I want to get into a view helper all messages from different namespaces (error, warning, notice, ok). A method like this is very helpful to handle this situation.
/**
* getCurrentNamespaces() - get all used namespaces
*
* @return array
*/
public function getCurrentNamespaces()
{
return array_keys(self::$_messages);
}
/**
* getNamespaces() - get all used namespaces
*
* @return array
*/
public function getNamespaces()
{
$namespaces = array();
foreach (self::$_session as $key => $namespace) {
$namespaces[] = $key;
}
return $namespaces;
}
Comments
Posted by David Nussio (david) on 2009-06-28T14:04:47.000+0000
Maybe this is not the best solution, sorry. I resolve better without these two method but using only hasMessages() and hasCurrentMessages.
Posted by Rob Allen (rob) on 2012-11-20T20:53:15.000+0000
Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".
Feel free to re-open and provide a patch if you want to fix this issue.