The Simple PHP Routing project source code. It provides an example of a routing based on functions.
Pre-requisites:
- git
- terminal
- Clone the repository to your local environment by running the command:
git clone [email protected]:mcspronko/simple-php-routing.git
- Navigate to the
simple-php-routing
directory:
cd simple-php-routing
- Start local server:
php -S localhost:9000
- Open browser
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";
});