注意:extend是放置第三方类的地方,不要乱配置命名空间那些,引起不必要的类错误 代码如下 <?php namespace app\index\controller; use think\Controller; use think\Db; use think\Loader; use think\Request; //use lib\PExcel; class Four extends Controller { //上传页面展示 public function index(){ return v
控制器文件: class ExcelAction extends Action { public function __construct() { import('ORG.Util.ExcelToArrary');//导入excelToArray类 } public function index() { $this->display(); } public function add() { $tmp_file = $_FILES ['file_stu'] ['tmp_name']; $file_