API15:JModuleHelper/getModules
From Joomla! Documentation
Description
Get modules by position
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getModules($position)
| Parameter Name | Default Value | Description |
|---|---|---|
| $position | $position The position of the module |
Returns
array An array of module objects
Defined in
libraries/joomla/application/module/helper.php
Importing
jimport( 'joomla.application.module.helper' );
Source Body
function &getModules($position)
{
$position = strtolower( $position );
$result = array();
$modules =& JModuleHelper::_load();
$total = count($modules);
for($i = 0; $i < $total; $i++) {
if($modules[$i]->position == $position) {
$result[] =& $modules[$i];
}
}
if(count($result) == 0) {
if(JRequest::getBool('tp')) {
$result[0] = JModuleHelper::getModule( 'mod_'.$position );
$result[0]->title = $position;
$result[0]->content = $position;
$result[0]->position = $position;
}
}
return $result;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples