如何在Joomla 1.5中的组件中获取模块参数?我正在使用此代码,但它显示空结果.
jimport( 'joomla.application.module.helper' );
$module = &JModuleHelper::getModule( 'mod_used_car_image');
$params = new JParameter($module->params);
print_r($params);
Run Code Online (Sandbox Code Playgroud)
您需要调用模块的“名称”,而不是模块的“类型”。
假设您将模块命名为“二手车图像”,您的代码应该是:
jimport( 'joomla.application.module.helper' );
$module = &JModuleHelper::getModule( 'Used Car Image');
$params = new JParameter($module->params);
print_r($params);
Run Code Online (Sandbox Code Playgroud)
这是手册:
http://docs.joomla.org/JModuleHelper/getModule