Routing

Static Pages

Routing is automated by file and folder creation within
front > html

team.html


 <h1>Team</h1>
 <h2>Let Me Introduce You!</h2>
 <p>This is a quick introduction to all of our team members.</p>
 

Dynamic Pages

Dynamic files are created within
back > templates


header.html & footer.html

Header and Footer files are included by default. These 2 files are included automatically to all pages from our master template file shown further below.


<!doctype html>
<html class="no-js" lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Website</title>
</head>
<body>
     


<footer>
    <p>Copyright 2018 PAX Agency. All Rights Reserved</p>
</footer>
 

template.php


require_once(FILE_APP);
$app = new app();

require_once(DIR_TEMP.'header.html');
require_once(DIR_PAGE.$_PATH);
require_once(DIR_TEMP.'footer.html');
     

This is where you can customize the master template of your page loads. By default, we require and load our master $app object, load the header, load the path route, and load the footer. However, if the route folder is "api" then just load the route path.


Editing Template File

To change what files are loaded automatically such as adding a nav.php or sideBar.php, simply create a nav.php & sideBar.php in your template folder, and then update the template.php to require these files.


require_once(FILE_APP);
$app = new app();

require_once(DIR_TEMP.'header.html');
require_once(DIR_TEMP.'nav.html');
require_once(DIR_PAGE.$_PATH);
require_once(DIR_TEMP.'sideBar.html');
require_once(DIR_TEMP.'footer.html');