Generally use rough THINKCMF, third-party libraries in simplewind/core/library/vendor/
Like we put Phpexcel in the vendor directory.
If your third-party libraries are placed under the vendor directory and both have. php as the class file suffix, and you don't use namespaces, you can use the system's built-in vendor function to simplify the import. For example, let's import the QR Code operations LibraryPhpexcel, putPhpexcelPut it under the vendor directory, this timePhpexcelThe path to the main file is simplewind/core/library/vendor/Phpexcel/Phpexcel. PHP, we use the vendor method to import only need to use:
Vendor (' Phpexcel.phpexcel ');//import class Library $objphpexcel = new \phpexcel ();//instantiation, note add \
This imports the Phpexcel class library and completes the instantiation of the
The vendor method can also support the same base path and file name suffix parameters as the import method, for example:
Vendor (' Phpexcel.phpexcel ', ' Simplewind/core/library/vendor ', '. php ');
Vendor Method:
Vendor ($class, $BASEURL, $ext)
Function:
Fast import of third-party framework class libraries, all third-party framework class library files are uniformly placed under the Simplewind/core/library/vendor directory of the system
Parameters:
$class: Class libraries, such as Phpexcel. Phpexcel
$BASEURL: Base directory, default Simplewind/core/library/vendor
$ext: Class library suffix, default to. php
This is thinkphp phpexcel Import Export Code
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
thinkphp Import Phpexcel