Friday, 28 February 2014

Rendering a module inside a component

The code to render module in component.

$document = &JFactory::getDocument();
$render = $document->loadRenderer('module');
$module = &JModuleHelper::getModule('Module Name');
$params = "p=vipul\n\rp1=patel";
$module->params = $params;
echo $render->render($module);

You can access both p and p1 parameters using.
$params->getValue("p") ;
$params->getValue("p1") ;


No comments:

Post a Comment