PHP » GoLang |
login |
register |
about
|
GoLang DOMDocument::registerNodeClass
request it (219)
GoLang replacement for PHP's DOMDocument::registerNodeClass
[edit | history]
PHP DOMDocument::registerNodeClassPHP original manual for DOMDocument::registerNodeClass [ show | php.net ]DOMDocument::registerNodeClass(PHP 5 >= 5.2.0, PHP 7) DOMDocument::registerNodeClass — Register extended class used to create base node type Description
public bool DOMDocument::registerNodeClass
( string
$baseclass
, string $extendedclass
)This method allows you to register your own extended DOM class to be used afterward by the PHP DOM extension. This method is not part of the DOM standard. Parameters
Return Values
Returns Changelog
Examples
Example #1 Adding a new method to DOMElement to ease our code
<?php The above example will output: <?xml version="1.0"?> <root><child foo="bar"/></root>
Example #2 Retrieving elements as custom class
<?php The above example will output: string(9) "myElement" text in child
Example #3 Retrieving owner document When instantiating a custom DOMDocument the ownerDocument property will refer to the instantiated class, meaning there is no need (and in fact not possible) to use DOMDocument::registerNodeClass() with DOMDocument
<?php The above example will output: string(13) "myDOMDocument" string(18) "myOtherDOMDocument" |
more
Recently updated
more
Most requested
more
Last requests
|