sherold-dev/zugferd-php

ZUGFeRD PHP SDK - Convert PHP Objects to XML and back.

v0.4-alpha 2020-03-02 09:26 UTC

This package is auto-updated.

Last update: 2025-06-29 00:44:36 UTC


README

ZUGFeRD PHP SDK - Convert PHP Objects to XML and back.

Look @ Tests for more details

Installation

The recommended way of installing this library is using Composer.

Add this repository to your composer information using the following command

composer require easybill/zugferd-php

Usage

Convert XML to PHP Objects:

use Easybill\ZUGFeRD\Reader;

$document = Reader::create()->getDocument('zugferd-file.xml');
echo $document->getHeader()->getId(); // Get invoice No.

Convert PHP Objects to XML:

use Easybill\ZUGFeRD\Builder;
use Easybill\ZUGFeRD\Model\Document;
 
$doc = new Document(Document::TYPE_COMFORT);
$doc->getHeader()->setId('RE1337'); // Set invoice No.

$xml = Builder::create()->getXML($doc);
echo $xml; // Zugferd XML.

Contributing

Please feel free to send bug reports and pull requests.

License

Published as open source under the terms of MIT License.