Issues

ZF-7150: Method to get all used namespaces

Issue Type: Improvement Created: 2009-06-28T06:50:00.000+0000 Last Updated: 2012-11-20T20:53:15.000+0000 Status: Closed Fix version(s): Reporter: David Nussio (david) Assignee: None Tags: - Zend_Controller

Related issues: Attachments:

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.

<pre class="highlight">
/**
 * 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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts