【问题标题】:Cannot pass parameter 2 by reference - cache not working无法通过引用传递参数 2 - 缓存不起作用
【发布时间】:2012-06-13 17:12:06
【问题描述】:

我有一个问题,当我为我的 Joomla 站点打开缓存时,我只收到错误消息:致命错误:无法通过 E:\sites\SC\xampp\htdocs\libraries\ 中的引用传递参数 2 joomla\document\html\renderer\module.php 在第 82 行

有问题的行是(从单行扩展以提高可读性):

$contents = $cache->get(
    array('JModuleHelper', 'renderModule'), 
    array( $module, $params ), 
    $module->id. $user->get('aid', 0)
);

我不知道如何解决这个问题,任何帮助将不胜感激。感谢您的宝贵时间。

【问题讨论】:

  • 您的问题首先需要一些基本的调试。该错误与$cache->get(...) 有关还是与$user->get(...) 有关?两个get 函数在同一行。

标签: php joomla


【解决方案1】:

你不能在 get() 方法中绑定参数——你应该事先做。
试试这个:

$param1 = array('JModuleHelper', 'renderModule');
$param2 = array( $module, $params );
$param3 = $module->id. $user->get('aid', 0);
$contents =  $cache->get($param1, $param2, $param3);

【讨论】:

  • 非常感谢 Alfasin,这很有帮助!
猜你喜欢
  • 2012-11-04
  • 2012-10-17
  • 2013-03-07
  • 1970-01-01
  • 2012-02-10
  • 2014-03-17
  • 2017-10-09
  • 2018-02-21
相关资源
最近更新 更多