Give us a second

GET STATIC ROUTES

Create static routes with GET

Static routing with GET

Pages like home, contact us, and about us, usually don't use variables in the URL. Therefore this is a static route using GET.

Here are some examples on how to create basic routes, pay attention to the single quotes around the route and the path where the file resides:

Route to the index page

In this example the "index.php" page is inside a folder called "views"


get(  '/' ,  'views/index.php'  );

Route to the about-us page

In this example the "about_us.php" page is inside a folder called "views"


get(  '/about-us' ,  'views/about_us.php'  );

Route to the contact-us page

In this example the "contact_us.php" page is directly under the root. It is possible to place files under the root of your project, yet it is advisable to place under sub-folders to have a better overview of your application.


get(  '/contact-us' ,  'contact_us.php'  );