PHP Traits naming convention?

What is the naming convention for using traits in a Zend Framework project?

My_Form_Element_Traits or My_Form_Element_Trait ?

I am thinking plural as it's a collection of methods and properties, however on the other hand it is one trait.

I also thought that maybe there are different traits I want to use so maybe it should be My_Form_Element_Traits_Preference

What is the best practice hear to this new feature?


You might be interested in what convention is used by PHP-FIG: https://github.com/php-fig/fig-standards/blob/master/bylaws/002-psr-naming-conventions.md

And in my opinion, even when you use ZF1, you shouldn't follow this convention. I recommend you to use PSR-2


在这里你当你使用_时,它将被正斜杠(/)反手代替,所以在这里你可以为其他多基因特性做一个基础类,以扩展那些主要的基础特征,我认为它是合适的,或者这是很好的做法,因为这里代码重复我们不允许你也可以看到zend库中的分页示例,你可以看到它

链接地址: http://www.djcxy.com/p/11618.html

上一篇: document.referrer提供重音字母

下一篇: PHP Traits命名约定?