thinkphp uses overtrue/wechat to load autoload.SegmentFault

WBOY
Release: 2016-08-25 10:37:34
Original
1614 people have browsed it

Excuse me, overtrue/wechat 3.1. After thinkphp is installed with composer, how to introduce the autoload.php under the vendor? I tried it in the entry file but it didn’t work. If I use require, an error will be reported. When I use include to introduce it in the public function, it is still Class 'OvertrueWechatServer. ' not found, please give detailed answers from those who have used it, thank you very much

Reply content:

Excuse me, overtrue/wechat 3.1. After thinkphp is installed with composer, how to introduce the autoload.php under the vendor? I tried it in the entry file but it didn’t work. If I use require, an error will be reported. When I use include to introduce it in the public function, it is still Class 'OvertrueWechatServer. ' not found, please give detailed answers from those who have used it, thank you very much

Introducing ThinkPHP first and then autoload.php will not work, just introduce autoload.php first


// 引入composer
require(__DIR__ . '/vendor/autoload.php');
// 引入ThinkPHP入口文件
require './ThinkPHP/ThinkPHP.php';

// 亲^_^ 后面不需要任何代码了 就是如此简单
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!