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

thinkphp自动加载问题

WBOY
Release: 2016-06-06 20:16:36
Original
1338 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:
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