Welcome Guest, Not a member yet? Register   Sign In
Naming a model class
#1

[eluser]mattalexx[/eluser]
In the docs, it mentions this:
Code:
class Blogmodel extends Model {}
Then it mentions this:
Code:
class User_model extends Model {}
What's the best way to name my models? Should I use the underscore or not? If the object name has more than one word, which one is it?:
Code:
class Item_Image_model extends Model {}
Code:
class Item_image_model extends Model {}
Code:
class ItemImage_model extends Model {}
Code:
class ItemImageModel extends Model {}
#2

[eluser]EEssam[/eluser]
I was confused as well then I decided to use "User_model".
#3

[eluser]sikkle[/eluser]
i usually keep it clear like :

User_model

Good luck !
#4

[eluser]Colin Williams[/eluser]
Just choose the style you prefer and stick with it throughout your application. I particularly like underscores and dispise camelCase, but to each his own.
#5

[eluser]mattalexx[/eluser]
[quote author="Colin Williams" date="1214216761"]Just choose the style you prefer and stick with it throughout your application. I particularly like underscores and dispise camelCase, but to each his own.[/quote]

This new piece of the user guide explains what I was trying to figure out:

http://ellislab.com/codeigniter/user-gui...hod_naming
#6

[eluser]Adam Griffiths[/eluser]
[quote author="mattalexx" date="1225417325"][quote author="Colin Williams" date="1214216761"]Just choose the style you prefer and stick with it throughout your application. I particularly like underscores and dispise camelCase, but to each his own.[/quote]

This new piece of the user guide explains what I was trying to figure out:

http://ellislab.com/codeigniter/user-gui...hod_naming[/quote]

And just as I was going to say to user _ rather than camel case, because CI does it all that way, and it says so in the user guide!!




Theme © iAndrew 2016 - Forum software by © MyBB