简体   繁体   English

Laravel 5.4-如何使用EDI供应商库

[英]Laravel 5.4 - How to use EDI Vendor Library

I have installed EDI Library through composer command. 我已经通过composer命令安装了EDI库。

Library Link. 图书馆链接。 https://github.com/php-edifact/edifact https://github.com/php-edifact/edifact

But in this, they did not give how to register your library in App file. 但是在此,他们没有提供如何在App文件中注册您的库的方法。

So can please help me how to register it. 所以可以帮我如何注册。 They are giving examples of how to use this. 他们提供了如何使用此示例。 I am just writing simple code. 我只是在编写简单的代码。

   $x = [1,5,8,9];
   $c = new Parser($x);

But the above code is giving an error. 但是上面的代码给出了一个错误。

Class 'Parser' not found 找不到类“解析器”

Try using new EDI\\Parser($x) . 尝试使用new EDI\\Parser($x) You need to tell php in what namespace to find the class you are looking for. 您需要告诉php在哪个命名空间中才能找到您要查找的类。

Run this command in your command prompt 在命令提示符下运行此命令

composer require sabas/edifact 

Use in the top of the file like: 在文件顶部使用,例如:

namespace EDITest;
use EDI\Parser;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM