How to get Module params in component area in joomla2.5

rynhe picture rynhe · Aug 29, 2012 · Viewed 9.4k times · Source

I want to get the module params in component area in joomla 2.5

Here my code :

jimport( 'joomla.application.module.helper' );
$module = &JModuleHelper::getModule('mod_module');
$moduleParams = new JParameter($module->params);
print_r( $moduleParams );

I try to print the $moduleParams...Its display nothing.
I got this code from the website http://www.themepartner.com/blog/25/retrieving-plugin-module-component-and-template-parameters/

Is there anyother way to get the params using the module name.

Answer

Rakesh Sharma picture Rakesh Sharma · Aug 29, 2012

for joomla 1.6 and higher

 jimport( 'joomla.application.module.helper' ); 
    $module = JModuleHelper::getModule('mod_name');
    $moduleParams = new JRegistry();
    $moduleParams->loadString($module->params);
    $param = $moduleParams->get('paramName', 'defaultValue'); 

Hope this help cause jparameter is deprecated in j1.5 higher

You missed the actual link i think for 1.7 is http://www.themepartner.com/blog/56/get-joomla-17-plugin-module-component-and-template-parameters/