Skip to content

πŸ”€ PHP Routing Framework β€” lightweight, multi-functional, and fast PHP routing solution. ⚑ Perfect for managing URL routing, APIs, and web routes. πŸ›‘ Supports middleware, clean code structure, and great flexibility. πŸš€ Ideal for powering up your backend projects!

Notifications You must be signed in to change notification settings

Iqbolshoh/php-routing-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”€ PHP Routing Framework

Welcome to php-routing-framework β€” your ultimate multi-functional PHP routing engine designed for modern web apps! πŸš€

πŸ“‚ Project Structure

/php-route-core
│── /app                  # Core PHP code (Routing Engine)
β”‚   β”œβ”€β”€ /Core             # Framework core files
β”‚   β”‚   β”œβ”€β”€ Router.php    # Manages URL routing
β”‚   β”‚   β”œβ”€β”€ Request.php   # Handles user requests
β”‚   β”‚   β”œβ”€β”€ Response.php  # Sends responses
β”‚
│── /routes               # Routing files
β”‚   β”œβ”€β”€ web.php           # Frontend routes
β”‚   β”œβ”€β”€ api.php           # Backend API routes
β”‚
│── /public               # Public directory (Entry point)
β”‚   β”œβ”€β”€ index.php         # Initializes the routing system
β”‚
│── /tests                # Unit tests
β”‚   β”œβ”€β”€ RouterTest.php    # Tests for the routing system
β”‚
│── .env                  # Environment variables (if needed)
│── .htaccess             # Apache server configuration (Pretty URLs)
│── composer.json         # PHP dependencies (Composer)
│── README.md             # Project documentation

πŸ’‘ Why Choose This Framework?

  • Lightweight & Fast ⚑ β€” Minimal footprint, optimized for speed.
  • Multi-functional Routing 🎯 β€” Supports GET, POST, PUT, DELETE routes and more.
  • Clean Code Structure πŸ“‚ β€” Modular design: clear separation of concerns.
  • Middleware Ready πŸ›‘οΈ β€” Add pre/post-processing for requests (auth, logging).
  • REST API Friendly 🌐 β€” Easily manage API endpoints alongside web routes.
  • Custom Response Handling πŸ“€ β€” Send JSON, HTML, redirects, or custom headers.
  • Environment Config Support 🌍 β€” .env ready for flexible deployment.
  • Unit Tested πŸ§ͺ β€” Stability ensured with built-in tests.

πŸ“Œ Installation

1️⃣ Clone the repository

git clone https://github.com/Iqbolshoh/php-routing-framework

2️⃣ Install dependencies using Composer

composer install

3️⃣ Ensure Apache is properly configured
Make sure .htaccess is enabled for pretty URLs.

πŸš€ Usage

βž• Adding a New Route

To add a new route, modify the routes/web.php file:

Router::get('/', function () {
    View::render('home');
});

Router::get('/about', function () {
    echo "<h1>Hello this is About page</h1>";
});

πŸ–₯ Technologies Used

PHP MySQL

πŸ“œ License

This project is open-source and available under the MIT License.

🀝 Contributing

🎯 Contributions are welcome! If you have suggestions or want to enhance the project, feel free to fork the repository and submit a pull request.

πŸ“¬ Connect with Me

πŸ’¬ I love meeting new people and discussing tech, business, and creative ideas. Let’s connect! You can reach me on these platforms:

About

πŸ”€ PHP Routing Framework β€” lightweight, multi-functional, and fast PHP routing solution. ⚑ Perfect for managing URL routing, APIs, and web routes. πŸ›‘ Supports middleware, clean code structure, and great flexibility. πŸš€ Ideal for powering up your backend projects!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published