Hi There,
I am about to start building a new PHP/MySQL application. I always use the traditional MVC architecture, however, I am thinking of making a small change with the way I set my application out.
Usually, each of my VIEW files independently calls the header HTML and footer HTML files.
I am thinking what I would like to do is have my entire application run through a single control file (eg, index.php). Each page would then be accessed by passing a GET value in the URL. Eg, instead of accessing certain pages directly, like this:
[url]www.somesite.com/about_us.php
[url]www.somesite.com/faq.php
[url]www.somesite.com/news_and_events.php
My site would instead load each page through index.php like this:
[url]www.somesite.com/?p=about_us
[url]www.somesite.com/?p=faq
[url]www.somesite.com/?p=news_and_events
What I am trying to decide is whether or not I should have the header and footer include commands in each individual VIEW file, or should I let the index.php file take care of that, meaning each VIEW file will only contain HTML <body> to </body> text?
Although having the header and footer include commands contained within the main index.php file seems to be cleaner and more modular, what if I want to include some extra information between the <head></head> tags of only [I]some
I’d love to get some insight in to how other people are structuring their applications in this respect.
Thank you.