update : 2015.11.03
php.shukuma.com검색:
|
DOMDocument::registerNodeClass(PHP 5 >= 5.2.0, PHP 7) DOMDocument::registerNodeClass — Register extended class used to create base node type 설명
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. 인수
반환값
성공 시 변경점
예제
Example #1 Adding a new method to DOMElement to ease our code
<?php 위 예제의 출력: <?xml version="1.0"?> <root><child foo="bar"/></root>
Example #2 Retrieving elements as custom class
<?php 위 예제의 출력: 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 위 예제의 출력: string(13) "myDOMDocument" string(18) "myOtherDOMDocument" |