Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cosminc's avatar

Best practice for naming your sub folders in the "views" folder

Hello everybody!

From a best practice point of view, what whould be the best way to name your folders in the "views" directory when you're referring to a module that has two words in its name.

For example, if I have the "MailingList" model and "MailingListController", the best way to name the views directory would be "mailing.list" or "mailing_list" or "mailingList" ?

Thanks.

0 likes
3 replies
newbie360's avatar

mailing.list is confuse with views/mailing/list.blade.php or views/mailing.list.blade.php

i will use mailing_list.blade.php

jlrdw's avatar

I use mailing_list, but mailingList is ok. I would not use mailing.list.

So mailing_list view = MailingList controller.

I try to stay away from compound view names, but hard sometimes.

cosminc's avatar

Thanks!

I will go for "mailing_list".

Regarding what jirdw said about compound view names, I would have chosen "list" for the model/controller/view but I thought that it might conflict with other reserved words. Maybe I'm wrong, I don't know :)

Please or to participate in this conversation.