What do you name your files when using MVC?

Posted by sprugman on Stack Overflow See other posts from Stack Overflow or by sprugman
Published on 2010-05-26T16:13:39Z Indexed on 2010/05/26 16:31 UTC
Read the original article Hit count: 151

Filed under:
|

When using the MVC pattern, which I'm not terribly experienced with, I find myself naming things like this:

/app/views/widget.php
/app/models/widget.php
/app/controllers/widget.php

That appeals to me because it's easy to find associated classes, and I lean towards shorter names when practical. However, when I'm looking in my IDE, I see three different files called widget.php, which is confusing. I'm tempted to add "_v", "_c", "_m" or something to each name. How do you handle this?

FWIW, I'm using CodeIgniter at the moment, and I don't know if there are any special benefits to using a particular convention, or any standard practices. Regardless, I'm intersted in the best-practices from various platforms.

© Stack Overflow or respective owner

Related posts about best-practices

Related posts about mvc