Welcome Guest, Not a member yet? Register   Sign In
Model naming conventions
#9

[eluser]Milos Dakic[/eluser]
I was searching around the forum to find the best way to name my models as well. Heaps of people have their little methods and ways which they are comfortable with.

I found it easier to name them as part of each module (as I'm using Modular Extension). So a models file will be specific to a module:

application/modules/module/models/module_model.php

In this you would replace "module" with the module name you are creating (eg. people). Then you would name the model. For this the best example is using the "People" module, which would make your model file people_global.php. Therefore this model could be used for all global aspects of the People module.

You could also make it more specific:

people_friends.php

Or something in that manner.

Its an easy way to remember which model is used for what, but is also useful if you take away the modular part of your system. If that is done all your models will stay in tact and can all be placed in the same folder.

Hope this helps someone who was looking for an easy naming convention.


Messages In This Thread
Model naming conventions - by El Forum - 05-22-2008, 01:57 PM
Model naming conventions - by El Forum - 05-22-2008, 03:03 PM
Model naming conventions - by El Forum - 05-22-2008, 03:42 PM
Model naming conventions - by El Forum - 05-22-2008, 05:10 PM
Model naming conventions - by El Forum - 05-22-2008, 08:07 PM
Model naming conventions - by El Forum - 05-22-2008, 09:16 PM
Model naming conventions - by El Forum - 05-22-2008, 11:22 PM
Model naming conventions - by El Forum - 05-22-2008, 11:34 PM
Model naming conventions - by El Forum - 09-10-2008, 12:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB