| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Application |
JModuleHelper |
getModules |
getModules() |
Never | Work in Progress |
Get modules by position
array &getModules ( $position )
| $position | string | The position of the module |
Example
$modules = &JModuleHelper::getModules('top'); foreach (array_keys($modules) as $m) { echo JModuleHelper::renderModule($modules[$m]); }
The example might render the following HTML snippet (possibly generated by the mod_newsflash module):
Example output
<table class="contentpaneopen"> <tr> <td valign="top" colspan="2"> Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic site. Manage all your content from the best CMS admin interface and in virtually any language you speak. </td> </tr> </table>
This is essentially the same as using <jdoc:include type="modules" name="top" style="none" /> in the site template.