Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 189c525

Browse files
committed
ENH: refs #253. Adding module webroots to the module view object.
This will allow a user to access a module's webroot through a variable of the form $<modulename>Webroot. This is very helpful for including javascript included in dependency modules.
1 parent 1b73851 commit 189c525

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/GlobalModule.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ public function __construct(Zend_Controller_Request_Abstract $request, Zend_Cont
3131

3232
$stack = debug_backtrace();
3333
$forward = $this->_getParam('forwardModule');
34+
35+
// Add variables to the view that allow the retrieval of any enabled module
36+
// webroots
37+
$allModules = Zend_Registry::get('modulesEnable');
38+
foreach($allModules as &$mod)
39+
{
40+
$modWebroot = $mod.'Webroot';
41+
$this->view->__set($modWebroot, $fc->getBaseUrl().'/modules/'.$mod);
42+
}
3443
}
3544

3645
/** pre dispatch (zend)*/

0 commit comments

Comments
 (0)