5
に私は次のエラーを取得しています:CakePHPの:コントローラ::リファラを使用する方法()ビュー
このによって引き起こさStrict (2048): Non-static method Controller::referer() should not be called statically,
assuming $this from incompatible context [APP/View/Questions/admin_edit.ctp, line 20]
:
//in app/View/Questions/admin_edit.ctp
echo $this->Html->link('Cancel', Controller::referer());
なぜ?
ありがとう:
はまた、ローカルオプションのparam $に注意してください。何らかの理由でURLを直接入力すると(リファラーなし)、フォールバックではなくドキュメントルート(example.com)が返されます。どんな考え? – emersonthis
これも私に起こります。私のローカルコピーでは、$ this-> referer()は正常に動作しますが、サーバ上ではドメイン名が吐き出されてしまいます。 –