Home >Backend Development >PHP Tutorial >thinkphp uses overtrue/wechat to load autoload.SegmentFault

thinkphp uses overtrue/wechat to load autoload.SegmentFault

WBOY
WBOYOriginal
2016-08-25 10:37:341773browse

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

<code class="php">
// 引入composer
require(__DIR__ . '/vendor/autoload.php');
// 引入ThinkPHP入口文件
require './ThinkPHP/ThinkPHP.php';

// 亲^_^ 后面不需要任何代码了 就是如此简单
</code>
Statement:
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