how to solve Non Static method in php 5.5 yii framework -



how to solve Non Static method in php 5.5 yii framework -

this big application working fine online, trying utilize download file , configure in local machine, download , configure stuck on point, error non-static method video::getvideodetails() should not called statically, assuming $this incompatible context

as on stackoverflow question, clue remove e_strict error_reporting used e_all. error still there

here part of code

foreach($modelvideo $bannervideo): $videotitle=video::getvideodetails($bannervideo->id); $videodirector=video::getdirector($bannervideo->user_id); ?> <div class = 'item'>

i not php developer, appreciate if find way solve issue.

thanks

just alter lines these

foreach($modelvideo $bannervideo): $videotitle=video::getvideodetails($bannervideo->id); $videodirector=video::getdirector($bannervideo->user_id); ?> <div class = 'item'>

to

foreach($modelvideo $bannervideo): $video = new video(); $videotitle=$video->getvideodetails($bannervideo->id); $videodirector=$video->getdirector($bannervideo->user_id); ?> <div class = 'item'>

getvideodetails , getvideodetails static functions , depend $bannervideo->id , $banner->user_id respectively. alternatively can declare them static function changing

public function getvideodetails

to

public static function getvideodetails

in model function, impact other places functions called, unless know doing don't alter model.

php yii

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -