a good php coding format ???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

a good php coding format ???

Post 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
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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)
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

Post 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..
Post Reply