diff --git a/README.md b/README.md index 2499874..75519bc 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,40 @@ This yocLibrary enables your project to send and receive with EPP (Extensible Pr `composer require yocto/yoclib-epp` -## Use +## Usage -*TODO* \ No newline at end of file +### Serializing + +```php +use YOCLIB\EPP\EPPDocumentHelper; + +$doc = EPPDocumentHelper::createEPPDocument(); + +$epp = $doc->createElementNS('urn:ietf:params:xml:ns:epp-1.0','epp'); + +$hello = $doc->createElementNS('urn:ietf:params:xml:ns:epp-1.0','hello'); + +$epp->appendChild($hello); + +$doc->appendChild($epp); + +$xml = $doc->saveXML(); +``` + +### Deserializing + +```php +use YOCLIB\EPP\EPPDocumentHelper; +use YOCLIB\EPP\Elements\EPPEppElement; + +$xml = ''; + +$doc = EPPDocumentHelper::createEPPDocument(); + +$doc->loadXML($xml); + +/**@var EPPEppElement $epp*/ +$epp = $doc->documentElement; + +$hello = $epp->getHello(); +``` \ No newline at end of file