Solved

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

Posted on 2010-09-02
10
722 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:jeremyBass26
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 11

Expert Comment

by:mattibutt
ID: 33592562
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
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 33592572
um sorry.. can you show me the code and restate that.. I didn't follow. tk
0
 
LVL 11

Expert Comment

by:mattibutt
ID: 33592580
hi
i meant you are calling other references question is what are you using like the name of the cms you are using?
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
LVL 4

Author Comment

by:jeremyBass26
ID: 33592649
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.
0
 
LVL 11

Expert Comment

by:mattibutt
ID: 33592677
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?
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 33592708
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?
0
 
LVL 11

Expert Comment

by:mattibutt
ID: 33592712
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
0
 
LVL 16

Accepted Solution

by:
HackneyCab earned 500 total points
ID: 33596157
The only part of the above code to which that error can possibly refer is:

fontin_adminHeader::jsNcss()

This is asking for the jsNcss function to be called as though it were a static method. (Method is the name used for a function which is defined inside a class.) But the error is telling you that jsNcss is not a static method, so it must be a non-static method, which means that only an object of the class should be able to call it.

I recommend you read the PHP documentation pages about object instantiation and static methods:

http://uk2.php.net/manual/en/language.oop5.basic.php
http://uk2.php.net/manual/en/language.oop5.static.php
0
 
LVL 4

Author Closing Comment

by:jeremyBass26
ID: 33601565
it lead me in the right direction.. tk
0
 
LVL 16

Expert Comment

by:HackneyCab
ID: 33603051
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.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Special characters in a TCPDF 4 28
PHP Underscores vs. Directory separators 5 29
How do i use the await event in php echo 5 19
PHP substring 3 16
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question