文件名、类名约定
通常,文件名匹配类名,类名采用驼峰命名法。
例:假如有一个类MyNiftyClass,那么它一定在 MyNiftyClass.php文件中
The Controller class KissesAndHugsController would be found in a file named KissesAnd-
HugsController.php
• The Component class MyHandyComponent would be found in a file named MyHandyComponent.
php
• The Model class OptionValue would be found in a file named OptionValue.php
• The Behavior class EspeciallyFunkableBehavior would be found in a file named EspeciallyFunkableBehavior.
php
• The View class SuperSimpleView would be found in a file named SuperSimpleView.php
• The Helper class BestEverHelper would be found in a file named BestEverHelper.php
本文详细解释了文件名与类名之间的约定规则,包括如何根据类名来确定文件名,以及常见类名对应的文件命名示例。
3808

被折叠的 条评论
为什么被折叠?



