从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');

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2021-05-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案