Jump to content

Basic structure of a PHP5 Webproject


tempi

Recommended Posts

Hi there,

 

Till now I normally created an Index site and included the sites with "index.php?id=news". I created a folder "sites" with all the site-includes.

 

for example include("sites/news.inc.php")

I saved the database connection information into a db.inc.php and included it in the index.php.

 

This was not object orientated programming and I intend to change that.

 

I was wondering if there is a good tutorial/template for a php5 (OOP) database-webproject.

 

How to arrange the classes & files? File structure? How to manage Database connections, where shall I save the connection params?

And so on....

 

Any hints?

 

Thanks

Tempi

 

Link to comment
https://forums.phpfreaks.com/topic/86275-basic-structure-of-a-php5-webproject/
Share on other sites

You can use smarty templet parsing engine to implement the MVC architecture in your php application

 

What does smarty have to do with mvc? Smarty is a template engine, not an mvc implimentation. Sure a template engine can be used within a framework that provides an mvc, but smarty itself does not impliment that design.

 

As for the op's question. There really is no definative answer. Its all a matter of preference.

 

Implimenting the mvc pattern can make your projects easier to maintain, but it has little to do with where you place your files.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.