Home > Backend Development > PHP Tutorial > php的命名空间层级与目录层级是一致的吗

php的命名空间层级与目录层级是一致的吗

WBOY
Release: 2016-06-06 20:21:01
Original
1193 people have browsed it

php,命名空间与文件目录对应关系

回复内容:

php,命名空间与文件目录对应关系

并没有直接的关联,当然了,推荐关联起来,不然管理会非常混乱,但你确实可以自己实现一个Autoload来管理“混乱”的namespace,只是不推荐那么做

请参阅:
http://php.net/manual/zh/function.spl-autoload-register.php

你也可以了解下PSR规范中的PSR-0和PSR-4,都和Autoload有关
http://www.php-fig.org/psr/psr-0/
http://www.php-fig.org/psr/psr-4/

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