Link to home
Start Free TrialLog in
Avatar of jeremyBass26
jeremyBass26Flag for United States of America

asked on

Strict Standards: Non-static method ... Want to clear it

Hello I'm getting this

Strict Standards: Non-static method  *foo:fake*  should not be called statically, assuming $this from incompatible context in

and I'm wanting to fix it..

Here is the code it refers to..


      public function GetHeaderHTML(){
            $obj =& $this->GetModuleInstance('fontin');
            if( is_object($obj) ){
                  global $gCms;
                  return $this->ProcessTemplateFromData(fontin_adminHeader::jsNcss());
            }
      }

Can some one tell me how to fix it and why the issue is?  I can't seem to google it right.. :/  thanks for the help.. Cheers -Jeremy
Avatar of mattibutt
mattibutt
Flag of United States of America image

you have codes which are part of the application its probably you are calling the reference which is not suppose to be called the way you have
Avatar of jeremyBass26

ASKER

um sorry.. can you show me the code and restate that.. I didn't follow. tk
hi
i meant you are calling other references question is what are you using like the name of the cms you are using?
Hello, sorry I'm not sure why the cms would matter... I want to know if the code is right.. it's listed as the cause.  I guess I'm looking for you to point at something and say that is the issue at this line

 return $this->ProcessTemplateFromData(fontin_adminHeader::jsNcss());

I guess I'm foggy here and looking for that to lift.  Thank you.
the code could be absolutely correct and work but the object its calling doesn't exists or do not have the same calling procedures so i asked you is there any additional codes i can understand if you dont want to share them but the problem must be ressolved within in its context this method means nothing if it has
if i am write you are using cms made simple?
That is correct, and I'm making my module E_STRICT friendly.  The obj is there and the code does work.  So, um is that what you where needing?
i am looking at the api http://www.cmsmadesimple.org/api/class_cms_module.html i am only seeing you are allowed to enter one parameter my view is you have a problem with these codes fontin_adminHeader::jsNcss() its better if you try another data to verify
ASKER CERTIFIED SOLUTION
Avatar of HackneyCab
HackneyCab
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it lead me in the right direction.. tk
In my opinion, PHP should terminate execution if non-static methods are called from a static context, otherwise it leads to the interpreter making risky assumptions. I'm hoping that PHP 6 starts to tighten such things.