Just thinking out loud here, but couldn't you create a front controller plugin that keeps track of the different modules it dispatches? It could then store it in a db... or something else. A view helper could be used to get the information out of there again.

MF

John Wiklund wrote:
This is one approach I have been playing with but it won’t work when the same
module is dispatched several times on one page.

Every instance of a module is stored in a db so I could easily create a
helper that creates an unique namespace for each dispatched module, but what
if the module is created by someone else? Maybe there should be a generic
way for creating module namespaces.

Hmm..the more I think about it the more I feel it's not possible to
accomplish. There is no way for ZF to know about each instance of modules on
a site.



rendered independently of each other (the same module could be dispatch
several times on one page).

You could always create a helper to do it:

    class Zend_View_Helper_GetNamespace
    {
        public $front;

        public function __construct()
        {
            $this->front = Zend_Controller_Front::getInstance();
        }

        public function getNamespace()
        {
            return $this->front->getRequest()->getModuleName();
        }
    }

Drop this in as a view helper, and you'd be able to use the notation you
display above.



--
Maurice Fonk

[EMAIL PROTECTED]
http://naneau.nl/

Scio me nihil scire

Reply via email to