Page 1 of 1

a good php coding format ???

Posted: Thu Feb 22, 2007 11:17 am
by PHPycho
Hello everybody..
i am back with some questions..
i am trying to develop my own php coding format..
For example:
db>dbConfig.php (db configuration file)
>db.class.php (db handlining functions)

images> here goes the static images..

pics >here goes the dynamic images ie uploaded etc..

js > here goes the .js files

css > here goes the .css files

etc etc..

and there may be different classes, libraries....

I want to develop a totally complete OO coding format (somewhat near to MVC), for example writing different class for mail handling,
error handling, session hanlding, file handling
for that i need help of yours...
Lets share our coding format over here so that a newbie can get
a bit idea to develop the effiecent and effective one...
thanks in advance to all of you

Posted: Thu Feb 22, 2007 11:58 am
by Kieran Huggins
for css, I've often stored everything in:

/styles/<stylename>/index.css <and other relative css includes>
/styles/<stylename>/images/<css images here>

I've often had one ./images directory per directory (when there are actual directories)

/js/jQuery.js
/js/<module or app>/<files>.js

For a while I used an /inc folder for all my includes. I've also used /.inc but had trouble with certain ftp programs / seeing the directory (big PITA factor).

These days I'm mostly using:

somewhere outside doc_root:
/m/<model-name>/
/v/<view-name>/ (xsl files)
/c/<controller-name>/
/data/<md5-of-file> (data storage)
/cache/ (filesystem cache of some DB objects)

inside doc_root
/css/<theme>/.... (same as styles above)
/js/.... (same as js above)
/index.php (front controller)

Posted: Thu Feb 22, 2007 12:46 pm
by PHPycho
Thank you Mr. Kieran Huggins
If you dont mind giving the coding sample using the above filestructure...
Many Many of us would be very greatful....
Thanks once again..