Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.