tp6 不能使用vendor

从thinkphp 5.1.x后vendor的使用方法发生变化,文档又没有详细说明。官方真的太坑了!

在thinkPHP 5.1.X后新版取消了Loader::import方法以及import和vendor助手函数,推荐全面采用命名空间方式的类以及自动加载机制,如果必须使用请直接改为php内置的include或者require语法。


原来的import(“Vendor.Classes.PHPExcel.IOFactory”);或Vendor(‘phpoffice.phpexcel.Classes.PHPExcel.IOFactory’);方法已经不再使用。

请使用下面的方法:

thinkphp6 使用vendor中的第三方库

require_once('/data/www/xxxxxxx/vendor/PHPExcel/PHPExcel.php');

猜你喜欢

转载自blog.csdn.net/I_lost/article/details/109675182