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.
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/
--
View this message in context:
http://www.nabble.com/Module-namespace-method-tf3803708s16154.html#a10764018
Sent from the Zend Framework mailing list archive at Nabble.com.