Files

TODO: Decide what to do about file naming conventions.

.class.php

I don't know if this is a good one or not, but somewhere, I picked up the semi-habit of naming class files with a ".class.php" extension, and files that are pretty much either invocation sequences or templates ".php". Sometimes I've distinguished between templates and invocation sequences with ".phtml" and ".php" respectively (or ".tpl" for template files, but I've backed away from that unless they're something other than php, such as smarty).

weston 09 Sep 2008

File Naming

Moving towards using multiple dots really helps you to quickly understand what the code does from the file name. I posted a long time ago a change I made to Zoop to allow me to add .class.php using the include function and it was added to Zoop. I do the same thing with css and javascript to help me understand the file I am working with. I have listed some extensions below that I have used that might be useful. JAVA uses lots of dots to describe not only what a file does, but who created the file.

.php (HTML and PHP display code)
.class.php (PHP class)
.code.php (Before moving to Zoop it was the work code for a page)
.js (YUI Compressed javascript)
.src.js (Uncompressed Javascript for dev mode)
.css (YUI compressed CSS)
.src.css (Uncompressed CSS)

jmorant@cloud9l... 09 Sep 2008

I think I prefer .php for

I think I prefer .php for classes, and .phtml or .tpl for HTML and PHP display code.

justin 30 Nov 2009