我的代码在ubuntu上的php 5.3.2-1中运行良好.我最近将它移植到安装了XAMPP的Windows中.它使用php 5.3.8.我收到了错误.
Non-static method Following::getUpdates() should not be called statically, assuming $this from incompatible context
Run Code Online (Sandbox Code Playgroud)
什么是路?我应该更正我的代码来替换代码中每个地方的声明或者
是否有办法模拟旧的行为(php 5.3.2 with php.ini file)因为我不确定在纠正之后会有多少错误会被抛到我脸上它.
更新(代码示例)
public function actionIndex(){
if(yii::app()->user->isGuest){
$this->render('guestIndex');
}
else{
$dataProvider = Following::getUpdates(yii::app()->user->id); //genrerate data for the homepage of user i.e updates from followers
$this->render('userIndex',array('dataProvider'=>$dataProvider));
}
}
Run Code Online (Sandbox Code Playgroud)
在线获取错误$dataProvider = Following::getUpdates(yii::app()->user->id);
我正在使用yii框架.