Skip to content

mcspronko/simple-php-routing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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";
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages