Skip to content

❄️ A small and secure routing mechanism for PHP projects

License

Notifications You must be signed in to change notification settings

henryhale/php-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-router

a better php routing mechanism

overview

PHP Router is a tested attempt to enhance the design of the php-router project on GitHub.

This repository contains source code for a better design that uses classes and adds features like asset handling. In addition to the features, better error handling and redirections are introduced in this design.

Significant differences from the original router include dynamic routing and project setup.

getting started

preresquities

Basic understanding of HTML and PHP language is required and installed on your machine.

steps

  1. Set up your project directory

    Clone or download this repository to your machine.

    Now you have two options here:

    • Place all downloaded the files under the root directory (html, htdocs, ow www) of your web server
    • Place the downloaded folder under the root directory (html, htdocs, ow www) of your web server. Create a virtual host on your web server and point it to that folder.
  2. In the browser, go to http://localhost or http://127.0.0.1 and you should see the homepage.

    In case you created a virtual host, open it in the browser.

NOTE:

  • Feel free to check out the source code as it is documented.
  • You may delete all routes in the routes.php file and create your own.
  • For better error handling, you may consider keeping the /404 route.

contributing

Contributions are welcome! Feel free to open an issue or open pull requests proposing a change.

license

Copyright © 2024 Henry Hale.

Released under the MIT License.

About

❄️ A small and secure routing mechanism for PHP projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published