Naming php files

2020-05-26 12:03发布

Is there any convention for naming php files? Not talking about php class files, but files that are mostly HTML with some php inside them. Should it be my-file-example.php or myFileExample.php or myfileexample.php?

标签: php html
7条回答
兄弟一词,经得起流年.
2楼-- · 2020-05-26 12:42

PSR-4 recommends using a directory hierarchy to represent the namespace.

For Object-Oriented programming, the autoloader can simplify code management with relatively little cost overhead at run time. This requires the capability to determine a file path from a class name - hence a linear transform of the latter is a good idea. This might be as simple as $className . ".php"

查看更多
登录 后发表回答