1

它与 PHP 或 Apache 配置有什么关系吗?

错误信息:

Non-static method SessionComponent::write() should not be called statically, assuming $this from incompatible context [APP\View\Households\add.ctp, line 64]

第 64 行: SessionComponent::write('ChildCounter', -1);

4

1 回答 1

7
SessionComponent::write() should not be called statically

那你为什么要这么做?:)

按照记录正确使用它:

$this->Session->write()

当然,在正确的范围内(控制器/组件)。

或使用静态 CakeSession 访问:

CakeSession::write()

在您的应用程序的其他任何地方。

于 2013-06-18T15:00:15.413 回答