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

thinkphp自动加载问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:16:361368browse


thinkphp自动加载问题

控制器

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

报错

thinkphp自动加载问题

回复内容:


thinkphp自动加载问题

控制器

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

报错

thinkphp自动加载问题

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

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

或者

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

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

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