【问题标题】:CakePHP and Smarty ProblemsCakePHP 和 Smarty 问题
【发布时间】:2011-07-28 20:18:08
【问题描述】:

我正在尝试将 SmartyView 与我的 Cakephp 设置一起使用。我去这里用过这个类:http://bakery.cakephp.org/articles/icedcheese/2008/01/14/smarty-view-for-1-2

但在执行时,我收到此错误:

注意(8):间接修改重载属性SmartyView::$Smarty无效[APP/views/smarty.php, line 58]

致命错误:无法通过引用重载对象进行分配

对于这一行: 父::__construct($controller); $this->Smarty = &new Smarty();

有没有其他人遇到过这个/知道该怎么做?谢谢!

【问题讨论】:

    标签: php cakephp smarty


    【解决方案1】:

    好吧,你不能pass arguments to magic methods by reference

    变化:

    $this->Smarty = &new Smarty();
    

    到:

    $this->Smarty = new Smarty();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-04
      • 2011-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-12
      • 2012-05-10
      • 2011-03-21
      相关资源
      最近更新 更多