Skip to content

Commit

Permalink
Add usage information
Browse files Browse the repository at this point in the history
  • Loading branch information
ben221199 committed Aug 7, 2024
1 parent fac2520 commit a56340e
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*
### 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 = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><epp xmlns="urn:ietf:params:xml:ns:epp-1.0"><hello/></epp>';

$doc = EPPDocumentHelper::createEPPDocument();

$doc->loadXML($xml);

/**@var EPPEppElement $epp*/
$epp = $doc->documentElement;

$hello = $epp->getHello();
```

0 comments on commit a56340e

Please sign in to comment.