PHP code example of tiime / cross-industry-invoice

1. Go to this page and download the library: Download tiime/cross-industry-invoice library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tiime / cross-industry-invoice example snippets


use Tiime\CrossIndustryInvoice\EN16931\CrossIndustryInvoice;
use Tiime\CrossIndustryInvoice\Renderer\CrossIndustryInvoiceRendererInterface;

class MyService
{
    public function __construct(private readonly CrossIndustryInvoiceRendererInterface $renderer)
    {
    }
    
    public function doSomething()
    {
        // Create CrossIndustryInvoice object with needed parameters
        $crossIndustryInvoice = new CrossIndustryInvoice(...);
        
        $this->renderer->render($crossIndustryInvoice, '@TiimeCII/en16931_invoice.html.twig')
    }
}