Yii Framework Forum: Classes Names - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Classes Names

#1 User is offline   gbasto 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 70
  • Joined: 28-September 10
  • Location:Portugal

Posted 25 January 2013 - 04:50 AM

Hi,

I was reading the Yii 2 coding style and the following caught my attention:

Quote

Class names MUST be declared in StudlyCaps. Core classes should be prefixed with C. For example, CController, CWidget. Application and extension classes should not use C as prefix. For extensions it's common to use E.


My question is... is still necessary the class names prefixes once we have namespaces? Why use CClass, EClass or Class if we are able to have \yii\Class, \extension\Class or \app\Class / \Class?


Cheers.
0

#2 User is offline   Hyprion 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 07-October 09
  • Location:Netherlands

Posted 25 January 2013 - 08:54 AM

In the example code posted by qiang the "C" prefix is not used, so I guess not. However the "E"-prefix could be usefull for extensions.
0

#3 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,387
  • Joined: 17-January 09
  • Location:Russia

Posted 25 January 2013 - 02:52 PM

Thanks. Fixed. That page is a draft I've started putting up together but haven't finished yet.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#4 User is offline   gbasto 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 70
  • Joined: 28-September 10
  • Location:Portugal

Posted 28 January 2013 - 05:11 AM

No problem. Congrats for the great work done so far. ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users