froens Posted June 28, 2007 Share Posted June 28, 2007 Hi there. I'm building a site where i'm trying to use the DOMApi supplied with PHP. The basic idea is to make all my bricks as small xml-nodes that can be apprehended by others. The problem is that i'm having problems with defining objects as attributes. I'm a bit rusty with the PHP-syntax so please bear over with me. class Treatmentlist extends DOMNode { private $pDomL; private $pParent; private $pInitialized; public function __construct($aParent) { $pParent = $aParent; $pDom = $aParent->ownerDocument; } .... some other methods ... } The problem is that when I refer to $pDom, it doesn't recognize it as an object of the type DOMDocument. What would solve my problem ? Quote Link to comment Share on other sites More sharing options...
no_one Posted June 28, 2007 Share Posted June 28, 2007 Not sure if this will answer your question, but I believe $pParent = $aParent should be $this->pParent = $aParent .. and so on. Also, you say $pDom where the private var is $pDomL .. ? Quote Link to comment Share on other sites More sharing options...
froens Posted June 29, 2007 Author Share Posted June 29, 2007 That would be a typo I guess. The problem is that it doesn't see $pDom as an object. So I can't call on it's methods CreateElement for instance. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.