Home > Backend Development > PHP Tutorial > thinkphp自动加载问题

thinkphp自动加载问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:16:36
Original
1379 people have browsed it


thinkphp自动加载问题

控制器

<code>    import('Org.Net.Geetestlib');
        $verify = new Geetestlib();</code>
Copy after login
Copy after login

报错

thinkphp自动加载问题

回复内容:


thinkphp自动加载问题

控制器

<code>    import('Org.Net.Geetestlib');
        $verify = new Geetestlib();</code>
Copy after login
Copy after login

报错

thinkphp自动加载问题

没用过ThinkPHP,不过看上去你这个应该是用法问题,可以试试

<code>import('Org.Net.Geetestlib');
$verify = new \Geetestlib();
//或者
$verify = new \Org\Net\Geetestlib(); //这个的可能性比较大</code>
Copy after login

或者

<code>use \Org\Net\Geetestlib;
import('Org.Net.Geetestlib');
$verify = new Geetestlib();</code>
Copy after login

$verify = new \Org\Net\Geetestlib(),还有Geetestlib.class.php有给出namespace Org\Net吗?

Related labels:
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
Latest Issues
Why thinkphp has better performance than laravel?
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
thinkphp versions supported by php6
From 1970-01-01 08:00:00
0
0
0
thinkphp upload files
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template