是否有任何命名PHP文件的约定?
不是在谈论PHP类文件,而是大多数HTML文件,其中包含一些PHP.
应该是my-file-example.PHP还是myfileExample.PHP或myfileexample.PHP?最佳答案PHP中没有明确的命名约定,它们可能因框架而异.如果你不使用任何框架,你可以使用一个流行的:
> with_underscores
> PascalCased
> camelCased
这个表很有用,并告诉你更多关于命名约定的信息(不仅是文件,还有类,方法和函数名称):
╔═══════════════════════╦═════════════╦════════════╦══════════════╦════════════╦════════════╗║ PHP Project ║ Classes ║ Methods ║ PropertIEs ║ Functions ║ Variables ║╠═══════════════════════╬═════════════╬════════════╬══════════════╬════════════╬════════════╣║ Akelos Framework ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║║ CakePHP Framework ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║║ CodeIgniter Framework ║ Proper_Case ║ lower_case ║ lower_case ║ lower_case ║ lower_case ║║ Concrete5 CMS ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║║ Doctrine ORM ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║║ Drupal CMS ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║║ Joomla CMS ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║║ modx CMS ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ lower_case ║║ Pear Framework ║ PascalCase ║ camelCase ║ camelCase ║ ║ ║║ Prado Framework ║ PascalCase ║ camelCase ║ Pascal/camel ║ ║ lower_case ║║ SimplePIE RSS ║ PascalCase ║ lower_case ║ lower_case ║ lower_case ║ lower_case ║║ Symfony Framework ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║║ wordpress CMS ║ ║ ║ ║ lower_case ║ lower_case ║║ Zend Framework ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║╚═══════════════════════╩═════════════╩════════════╩══════════════╩════════════╩════════════╝
请记住与命名约定保持一致. 总结
以上是内存溢出为你收集整理的命名php文件全部内容,希望文章能够帮你解决命名php文件所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)