user3707264
user3707264

Reputation: 328

Loading Class In PHP Project Using Composer

I have difficulties to use this project : https://github.com/php-sepa-xml/php-sepa-xml

I set up everything with composer but I don't know how to generate the xml file.

In the doc folder, there is a sample file, I copy / paste the content in a new php file

<?php
use Digitick\Sepa\TransferFile\Factory\TransferFileFacadeFactory;
use Digitick\Sepa\PaymentInformation;

// Code....
?>

when I run the code I have an error:

Fatal error: Uncaught Error: Class 'Digitick\Sepa\TransferFile\Factory\TransferFileFacadeFactory' not found
 in C:\dev\php-sepa-xml\vendor\digitick\sepa-xml\lib\sample.php:5

I tried to move my php file in different folders and also to change the path but I always have the error.

Note: I'm on Windows so the path may be different.

Upvotes: 0

Views: 311

Answers (1)

Dolly Aswin
Dolly Aswin

Reputation: 2794

If you set it up using composer, please add autoloader in the top of php file.

<?php
require "vendor/autoload.php";
use Digitick\Sepa\TransferFile\Factory\TransferFileFacadeFactory;
use Digitick\Sepa\PaymentInformation;

// Code....
?>

Upvotes: 4

Related Questions