Yii Framework Forum: yiic Conventions by CRUD - Yii Framework Forum

Jump to content

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

yiic Conventions by CRUD Rate Topic: -----

#1 User is offline   me23 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 20-October 08
  • Location:Germany

Posted 08 November 2008 - 08:45 PM

Hello,

corresponding to the Conventions-Section of the Definitive Guide to Yii  http://www.yiiframew...sics.convention
i found this under "Code":

Quote

Yii recommends naming variables, functions and class types in camel case which capitalizes each word in the name and joins them without spaces

...

A special rule for controller class names is that they must be appended with the word Controller. The controller ID is then defined as the class name with first letter in lower case and the word Controller truncated. For example, the PageController class will have the ID page. This rule makes the application more secure. It also makes the URLs related with controllers a bit cleaner


My Table is named "ProjectStatistic". After creating the model
and calling "crud ProjectStatistic", the name of the controller is 'ProjectstatisticController'.
If i interpreting the Yii-Guide right, it should be 'ProjectStatisticController'.

Also the view-Folder is called 'projectstatistic' instead of 'projectStatistic'.

It took me some time till i figure out what is wrong, while i tried to adopt
the crud-file to an other table for learning purpose.

I don't know if this really matter, because normally we would use yiic to
create the files. On the other hand is camelCase easier to read on large
projects.

Greetings from Germany
me23


0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,857
  • Joined: 04-October 08
  • Location:DC, USA

Posted 08 November 2008 - 08:54 PM

Fixed. Thanks!
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