Welcome Guest, Not a member yet? Register   Sign In
Naming Conventions - Views
#1

[eluser]m40[/eluser]
I guess we can differentiate the following 2 types of Views:

1 - Views that exist to serve one certain controller function.
2 - Views that are reused in multiple controller functions. Such are header and footer Views.

My question concerns naming conventions. Naming a type 1 View is easy. You can always use something like view_[controller][function].php.

How do you name a type 2 View though?
#2

[eluser]jedd[/eluser]
[quote author="m40" date="1250567430"]
My question concerns naming conventions. Naming a type 1 View is easy. You can always use something like view_[controller][function].php. [/quote]

Having the string 'view' in the name of a view file is redundant, as the file exists within the subdirectory 'views'.

A better variation is to have the file called ./application/views/controller/function.php

Quote:How do you name a type 2 View though?

For me, they exist in ./application/views/common/
#3

[eluser]m40[/eluser]
Thanks for the prompt reply!

I actually use just a "v_" prefix in my views and I do that because this way when I have a look at the tabs in my code editor I can easily figure out which files are views an which are not.
#4

[eluser]jedd[/eluser]
Ah yes, one of those annoying times when you have to change your coding practices to suit the limitations of your IDE.

Shame you can't convince IDE's to show parent directory / filename in each tab.

Perhaps NetBeans will introduce that in version 19 -- of course even then they still won't have an option to show tab-stops, despite shipping on two DVD's.

My workaround for the problem is to open my controller, then my model, then my view(s) - so the order is consistent, and anything from tab 3 across is a view. Of course, I occasionally have to open other files, but they all stand out like the proverbial (MY_Controller, MY_model, pdb_helper, etc).
#5

[eluser]m40[/eluser]
Quote:Ah yes, one of those annoying times when you have to change your coding practices to suit the limitations of your IDE.

Exactly!

I wish IDEs were more configurable in that aspect.

Thanks for sharing your workaround!




Theme © iAndrew 2016 - Forum software by © MyBB