Categories > TinyButStrong general >

What is the best file structure?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: howman
Date: 2005-09-20
Time: 22:43

What is the best file structure?

Hey Skrol,

Just wondering if there is a preferred way to set up the file structure at the beginning of a new project.

In your examples for testimonial and forum, all of your files are in one directory.  In other template engines I have seen, they keep the templates separate from the php files.

I think maybe this would be good:

/ (root)
contains tbs_class.php and db connect file

/htdocs (the web root)
contains the php files (controller)

/templates
contains the template files (view)

/lib
contains php files that are classes (model)

Now where would I put images?  Under the templates folder or under the htdocs folder?  This is an interesting question when using Dreamweaver.

If I create subfolders under htdocs, how do those files find tbs_class.php?  Should I create a common.php file at the root to keep track of absolute paths?

Thanks!
By: Skrol29
Date: 2005-09-22
Time: 16:09

Re: What is the best file structure?

Hello,

There is no best way of file emplacement with TBS.
It depends of your own way of coding and organizing applications.

When the application is simple (let's say less than 30 files) I like to have only one folder for the whole application.
This way, it is more easy install/uninstall/move.