Home > Backend Development > PHP Tutorial > php有这样的语法么

php有这样的语法么

WBOY
Release: 2016-06-06 20:52:11
Original
1033 people have browsed it

在doctrine配置时有这样的语法,php有这样的语法么,也不会出错。

require 'Doctrine/ORM/Tools/Setup.php';
$lib = "/path/to/doctrine2-orm/lib";
Doctrine\ORM\Tools\Setup::registerAutoloadDirectory($lib);
?>

namespace Sandbox;

use Doctrine\Common\ClassLoader,
Doctrine\ORM\Configuration,
Doctrine\ORM\EntityManager,
Doctrine\Common\Cache\ApcCache,
Entities\User, Entities\Address;

回复内容:

在doctrine配置时有这样的语法,php有这样的语法么,也不会出错。

require 'Doctrine/ORM/Tools/Setup.php';
$lib = "/path/to/doctrine2-orm/lib";
Doctrine\ORM\Tools\Setup::registerAutoloadDirectory($lib);
?>

namespace Sandbox;

use Doctrine\Common\ClassLoader,
Doctrine\ORM\Configuration,
Doctrine\ORM\EntityManager,
Doctrine\Common\Cache\ApcCache,
Entities\User, Entities\Address;

有的,这是php的namespace写法,反斜杠标示了命名空间的层级,不过这个只有在php 5.3里才能使用。

Related labels:
php
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