Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 715 Bytes

README.md

File metadata and controls

40 lines (26 loc) · 715 Bytes

Simple PHP Routing

The Simple PHP Routing project source code. It provides an example of a routing based on functions.

Installation

Pre-requisites:

  • git
  • terminal
  1. Clone the repository to your local environment by running the command:
git clone git@github.com:mcspronko/simple-php-routing.git
  1. Navigate to the simple-php-routing directory:
cd simple-php-routing
  1. Start local server:
php -S localhost:9000
  1. Open browser

How to add a new route

Navigate to the index.php file and add a new route. For example, if you need to have a contact page, the following needs to be added.

route('/contact', function () {
  echo "Contact";
});