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 に答える