I need to display a module in administrator side by getting the module using it's module position (see the code below). I am having error & doubt is using the code:
$renderer = $document->loadRenderer('module');
This JDocumentRenderer
is not working in Joomla latest version 3.x. I also referred the link:
JDocumentRenderer does not extend JObject anymore. You must not use any of JObject's methods
But I need to render the module...
$modules = JModuleHelper::getModules("dashboard_main");
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$attribs = array();
$attribs['style'] = 'xhtml';
foreach($modules as $mod){
// this code is not rendering the module
echo $renderer->render($mod, $attribs);
}