这么写是怎么回事

WBOY
Release: 2016-06-23 13:34:59
Original
916 people have browsed it

看到别人这么写
$veiryt=new \Think\home();
是不是写错了


回复讨论(解决方案)

Thinkphp框架实例化

Thinkphp框架实例化


实例化也不能用\斜杠哈

$veiryt=new \Think\home();

实例化命名空间 Think 中的 home 类
显然这段代码不是在 Think 命名空间内,所以要 \Think 来指示位置

命名空间,php5.3之后就可以这样写

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