Welcome to php-routing-framework
β your ultimate multi-functional PHP routing engine designed for modern web apps! π
/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
- 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.
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.
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>";
});
This project is open-source and available under the MIT License.
π― Contributions are welcome! If you have suggestions or want to enhance the project, feel free to fork the repository and submit a pull request.
π¬ I love meeting new people and discussing tech, business, and creative ideas. Letβs connect! You can reach me on these platforms: