[英]Load custom html module with JModuleHelper::getModule in Joomla
我正在使用以下代码渲染joomla! 模块:
jimport('joomla.application.module.helper');
$module = JModuleHelper::getModule('AddToCartReplacementBtn');
echo JModuleHelper::renderModule($module);
但是在我的特定情况下它似乎不起作用
我正在加载名为AddToCartReplacementBtn
的自定义HTML模块。 它的位置也是AddToCartReplacementBtn
该文档说,我可以按模块的真实名称或文件夹加载模块。
还有其他方法可以按其真实名称加载模块吗?
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$module = JModuleHelper::getModule('mod_custom','AddToCartReplacementBtn');
echo $renderer->render($module);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.