لديك حساب بالفعل؟ دخول
دخول  سجل الأن 
Quick Table of Contents
[تحسين] 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";

} 
30 / أكتوبر / 2011 الساعة 18:39