kade119 Posted September 17, 2009 Share Posted September 17, 2009 I'm trying to incorporate PHP into my sites to make my life a bit easier in the long run.. So could a few of you experienced programmers give me some insight on how you structure your sites, should I build one index.php file and my additional pages load into that index file? or should each page be in a sub folder or all pages on the root? if anyone has a little time to shed some light on the best structure they found that worked for them thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/174619-php-includes-site-structure-question/ Share on other sites More sharing options...
Garethp Posted September 17, 2009 Share Posted September 17, 2009 I personally like to keep all my files in one folder. I hate structure. But lately in doing proffessional work, I've been told to put includes in a subfolder, styles in another subfolder, classes in yet another, and admin files in a fourth subfolder. But I still keep all my main page in the root Quote Link to comment https://forums.phpfreaks.com/topic/174619-php-includes-site-structure-question/#findComment-920249 Share on other sites More sharing options...
KevinM1 Posted September 17, 2009 Share Posted September 17, 2009 I'm pretty OCD about file structure, so I like having folders for raw HTML includes, images, CSS files, etc. I find that a consistent file structure across projects makes it easier for me to port over various bits and pieces, as I know how my sites are laid out physically. In terms of site structure - how a script is organized programmatically to deliver the desired content to the user - it depends on how complex the site is. Bigger sites benefit from some sort of controller resting on top of everything, delegating request information to the parts of the script that need it. Smaller sites benefit from a more direct approach, without that kind of overhead. There's no one-size-fits-all solution. Instead, it all depends on what the site needs to do. Quote Link to comment https://forums.phpfreaks.com/topic/174619-php-includes-site-structure-question/#findComment-920276 Share on other sites More sharing options...
kade119 Posted September 17, 2009 Author Share Posted September 17, 2009 well if i do keep all my core pages on the root, is it still beneficial to insert bread crumbs and also have a few includes, such as my header,footer,menu? Quote Link to comment https://forums.phpfreaks.com/topic/174619-php-includes-site-structure-question/#findComment-920314 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.