PHP is a largely flexible language, I could do this anyhow and anywhere. However, what would you consider to be best practices for structuring large projects?
I have built a bespoke CMS for a client, but as it was my first venture into a large project its a bit of a mess. There's files everywhere, with a very bad folder structure.
A friend suggested that the only files that should sit in the root directory of the website are the "page" files - i.e. the files that actually have HTML in them and that you should have separate folders for each of the different elements, which can then be easily pulled into different pages with includes. Would everybody recommend this route or is it governed entirely by personal preference?