Skip to content

Parameter 3 to smarty_block_mynocache() expected to be a reference

2009 十二月 13
tags:
by 荒野无灯

php5.3 下,smarty 3.0b5部分缓存出错,提示错误信息为:

Warning: Parameter 3 to smarty_block_mynocache() expected to be a reference, value given in D:\htdocs\project\***\libs\sysplugins\smarty_internal_plugin_handler.php on line 28

定义的部分缓存函数为:

1
2
3
4
function smarty_block_mynocache($param, $content,&$smarty)
{
    return $content;
}

此函数在php5.3+ smarty 3.0b4环境下没有任何错误提示(配置php显示所有错误 ),但换用smarty 3.0b5后出现错误了。
根据提示信息,我把函数修改为:

1
2
3
4
function smarty_block_mynocache($param, $content,$smarty)
{
    return $content;
}

结果与我设想的一样,错误被 KILL 了。
即把引用参数处的&号去除。

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=3392

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS