Skip to content

Instantly share code, notes, and snippets.

@jbanety
Created June 13, 2016 11:36
Show Gist options
  • Save jbanety/48e50d3c0a1892b51051ac6287496715 to your computer and use it in GitHub Desktop.
Save jbanety/48e50d3c0a1892b51051ac6287496715 to your computer and use it in GitHub Desktop.
Render joomla modules in templates
function _load($position, $style = 'none') {
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$modules = JModuleHelper::getModules($position);
$params = array('style' => $style);
foreach ($modules as $module) {
echo $renderer->render($module, $params);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment