要构建php MVC,我需要注意哪些命名约定? [英] going to build a php MVC, what naming conventions do i need to be aware of?
问题描述
我对OO PHP还是很陌生,但是我了解了它的工作方式,并准备开始为我正在工作的大型站点构建MVC.我知道没有必要写您必须这样做,但是必须有一些常规做法....
I'm pretty new to OO PHP, however i get how it all works and am ready to start building an MVC for a big site i'm working on. I know it isnt necessary written that you must do it like this but there's gotta be some normal practises....
类名-camelcase?下划线?
class names - camelcase? underscores?
课程文件-与课程相同吗?
class files - same as class?
网址/帖子/获取控件名称-router.php?
url/post/get controll name - router.php?
在登船之前我应该注意的其他事项吗?
any other things i should be aware of before i embark?
推荐答案
只要保持一致,如何命名都没有关系.
It doesn't really matter how you name things as long as you are consistent.
如果您有兴趣了解编码标准:
If you are interested in taking a look at coding standards:
- Zend Framework Coding Standard for PHP
- PEAR Coding Standards
- Horde Coding Standards
这篇关于要构建php MVC,我需要注意哪些命名约定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!