A lightweight, modern, and PSR-compatible PHP MVC framework designed for building web applications.
- PSR-4 Autoloading
- PSR-11 Container Implementation
- Modern PHP 8.1+ Support
- Dependency Injection Container
- Routing System
- Request/Response Handling
- Configuration Management
- Clean Architecture
- PHP 8.1 or higher
- Composer
composer install
- Create a new route in
public/index.php
:
$app->getRouter()->get('/hello', function(Request $request) {
return new Response('Hello World!');
});
- Create a controller:
namespace App\Controllers;
use SdFramework\Http\Request;
use SdFramework\Http\Response;
class HomeController
{
public function index(Request $request): Response
{
return new Response('Welcome to SdFramework!');
}
}
- Register the controller route:
$app->getRouter()->get('/', [HomeController::class, 'index']);
/project-root
├── app/
│ ├── Controllers/
│ ├── Models/
│ └── Views/
├── config/
├── public/
│ └── index.php
├── src/
│ ├── Container/
│ ├── Http/
│ └── Routing/
├── tests/
├── vendor/
├── composer.json
└── README.md
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.