【问题标题】:Joomla 2.5 loadRenderer module error on Virtualmin serverVirtualmin服务器上的Joomla 2.5 loadRenderer模块错误
【发布时间】:2017-10-09 22:29:25
【问题描述】:

我是新手,在迁移 joomla 网站时遇到错误。当我加载网站时,顶部菜单给出以下错误。其余网站运行良好。

希望有人可以指导我。

顶部菜单抛出错误。

loadRenderer('module');
$params = array('style'=>$style);
$contents = '';
foreach (JModuleHelper::getModules($position) as $mod) {
    $contents .= $renderer->render($mod, $params);
} // this part allows html characters to show correctly
echo html_entity_decode($contents);
?>

下面是代码

            <?php endif; ?>
        <div id="blankdiv"></div>
        <nav class="topMenu">
          <?
                // extra code to make this work
                $style = -2; // set the style
                $position = "mainmenu"; // set the position of the modules to be loaded
                // end of extra code

                $document   = &JFactory::getDocument();
                $renderer   = $document->loadRenderer('module');
                $params      = array('style'=>$style);

                $contents = '';
                foreach (JModuleHelper::getModules($position) as $mod)  {
                $contents .= $renderer->render($mod, $params);
                }

                // this part allows html characters to show correctly
                echo html_entity_decode($contents);
            ?>
        </nav>
      </section>

【问题讨论】:

  • 请提供所有可能的详细信息,以帮助更好地了解您的问题。例如,错误消息至关重要。
  • 抱歉问题不完整。已经编辑问题。而不是显示顶部菜单,而是显示 loadrenderer 错误。我该如何解决?

标签: php joomla2.5


【解决方案1】:

这并不完全是错误消息,而是源代码。

我建议查找包含这些行的文件(它们可能是多行,因此通过一些片段(例如// this part allows html characters to show correctly)搜索并检查该文件是否具有正确的php开始标记,即&lt;?php。

很可能它会有一个速记 (&lt;?) 或其他可能不再兼容/不受支持的东西。设为&lt;?php

【讨论】:

  • 非常感谢伙计。你确实拯救了我的一天。
  • @KuganMV - 将答案标记为已接受(如果它是正确的并且确实对您有所帮助)是这里最好的“谢谢”形式:)
猜你喜欢
  • 2012-11-14
  • 2012-10-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-03
  • 1970-01-01
  • 2012-07-05
  • 1970-01-01
相关资源
最近更新 更多