I am not sure if I am allowed to ask a more practical question here as this question is not as much support as just giving good advice.
I have a front controller with a simple layout manager (lack of a better term) which effectively loads a default (or custom if so specified) html "layout", or skeleton, and based on the users page request, will insert another file (called view files) into the skeletons content area.
A skeleton could look something like:
<div id="header">
<h1>head goes here</h1>
<div id="content">
<?php $this->insertContent(); ?>
</div>
<div id="footer">
<p>footer goes here</p>
</div>
Although pretty simple, this makes it easy to make future updates because if a client would now want me to add a jquery scroller, I can add it to the single layout as appose to having to edit multiple documents to achieve the same thing.
My friend however says that he thinks this is not a good solution and believes that I should not split my "view" files and layouts, but rather stick with the front controller and my html pages should use php include (include header and footer) and keep my html pages in as 1 file because:
- A layout manager would make my application less flexible as I am binding myself to a single layout (unless I create a new layout and in my page controller file specify that it should use a different layout).
- Other developers would have a tough time understanding the logic and I am creating more work than is needed
- Simple HTML developers would not be able to do proper testing as they can only really work on snippets as appose to whole HTML documents and see the bigger picture.
- It's more confusing because to make changes to a page I need to make ammendments in either a view file or skeleton file and you need to know when skeleton file to edit.
I will soon start to develop a project which will have multiple development stages, and it is crucial for me to make a decision about this as I want the application to be as flexible as possible and create as little work as possible, but also build it so that I can easily make ammendments, improvements or changes to the site. I would really value some advice as this argument now is based on 2 people's individual opinions. Any points to consider, and possibly information as to how bigger mainstream frameworks and CMS's work would also help me make a better decision.