thinkphp Import Phpexcel

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.