Blog

DIY CMS Part 2

2018-01-14

How a Page is Built

The index.php file is the first file accessed upon a server request and has to do all the heavy lifting.    First, index.php has to figure out which page is requested.   If the request has come from one of the website pages, there will be a query string with the page name.   If the query string is empty - first time on website, or user clicks the header,  the default page is 'home'.

After learning which page is requested, index.php reads the character string associated with that page  This string tells index.php what layout to build and which blocks of content to collect.    When all information is on hand, index.php 'puts the cookies in the oven' - sends it all to the user's browser.

(In case you are worried that index.php is overworked, there are lots of 'includes' to bring in extra helpers.)

 

Here's the flow:

flowchart

Example of a page composed of content blocks in a 2-column layout. 

page layout

Stayed tuned for Part 3

Category: tutorial
Comments for DIY CMS Part 2

Leave a Comment

Email

Name

Subject

Message: