Have an account? Sign in
Login  Register  Facebook
This Page is Under Construction! - If You Want To Help Please Send your CV - Advanced Web Core (BETA)
Quick Table of Contents
[Edit] Fatal Error: Call to undefined method
This error usually renders when a coder working with PHP classes forgets to define an object correctly in their calling script, then attempts to access that object's methods. It can also render when you forget to place $this-> when refering to on object and its methods.

How can i fix it

Use the method_exists() php function it will check to see if a method exists or not in your script before you try to use it, thus defeating this Fatal Error. However it is best to learn how to properly define object instances and communicate through them to defeat this error most efficiently, and not require a check like the one below.
if (method_exists($myObjectInstance,"method")) {

    echo "methodName is available for use";

} else {

    echo "methodName is NOT available for use";

} 
October 30, 2011