I have two classes in a module (WriteTheXML.php and ViewFeed.php), and I wish to invoke a function in WriteTheXML from ViewFeed (the function being called is writeXMLFile())
I'm can't find the right syntax to use, these are a few I've tried and the errors I get.
Code:
writeXMLFile($parentid);
//Call to undefined function writeXMLFile($parentid);
$this->writeXMLFile($parentid);
//Fatal error: Call to undefined method ViewFeed::writeXMLFile() .....
WriteTheXML:writeXMLFile($parentid);
//Non-static method WriteTheXML::writeXMLFile() should not be called statically, assuming $this from incompatible context .....
$this->WriteTheXML->writeXMLFile($parentid);
//Fatal error: Call to a member function writeXMLFile() on a non-object ......
$anobject = WriteTheXML::writeXMLFile($parentid);//Non-static method WriteTheXML::writeXMLFile() should not be called statically, assuming $this from incompatible context
$anobject = WriteTheXML->writeXMLFile($parentid);
//Parse error: syntax error, unexpected T_OBJECT_OPERATOR
OOP DUMMY ... Clues appreciated
Bookmarks