A simple and lightweight PHP framework that implements the Model-View-Controller (MVC) architectural pattern. Designed to be easy to understand and extend, MVClearPhp is an excellent starting point for building web applications or learning about MVC architecture.
To use MVClearPhp, you'll need a web server with PHP support. Follow these steps to get started:
git clone https://github.com/Vimpil/MVClearPhp.git- Configure your web server (e.g., Apache, Nginx) to point to the
publicdirectory. - If your application requires a database, set up the connection by editing the configuration file (e.g.,
config/database.php).
For a complete list of dependencies, see the composer.json file. If Composer is used, run:
composer installMVClearPhp follows the standard MVC structure:
- Models: Define your data structures and business logic in the
app/modelsdirectory. - Views: Create your templates in the
app/viewsdirectory. - Controllers: Handle requests and interact with models and views in the
app/controllersdirectory.
Define a route
In config/routes.php, add a new route:
$router->get('/hello', 'HelloController@index');Create a controller
In app/controllers/HelloController.php:
class HelloController extends Controller {
public function index() {
return view('hello');
}
}Create a view
In app/views/hello.php:
<h1>Hello, World!</h1>Visit /hello in your browser to see the result.
- Simple routing system for handling HTTP requests
- Easy-to-use templating for views
- Basic ORM for database interactions
- Modular structure for easy extension and customization
- PHP
- Composer (for dependency management)
Contributions are welcome! Please feel free to submit a pull request or open an issue if you find any bugs or have suggestions for improvements.
This project is licensed under the MIT License. See the LICENSE file for more details.