Download the PHP package belicfr/mvclite-core without Composer
On this page you can find all versions of the php package belicfr/mvclite-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mvclite-core
MVCLite official repository: Click here
About MVCLite
MVCLite is a lightweight MVC (Model-View-Controller) framework for building web applications in PHP. It provides a robust foundation for structuring your application's codebase, including features such as middlewares, routing system, ORM (Object-Relational Mapping), Twig templating engine integration, and more.
Features
- Routing System: Define clean and intuitive URL routes to handle various HTTP requests.
- Middlewares: Easily integrate pre-processing and post-processing logic into your application's request-response cycle.
- ORM (Object-Relational Mapping): Simplify database interactions by mapping database tables to PHP objects.
- Twig Integration: Use the Twig templating engine for separating logic from presentation in your views.
- And More: MVCLite includes many other features to streamline your development process.
Installation
You can install MVCLite via Composer. Run the following command in your terminal:
After installing MVCLite, you have to configure your application's settings in the config
directory. The config.php
file contains the main settings for your application.
You also have to configure the htaccess file, you can use the .htaccess_example
file as a base.
Usage
Router
Define your application's routes in the src/Router/routes.php
file. Here's an example of a simple route:
You can also define routes with a custom name
ORM
The build-in ORM allows you to interact with your database. Here's an example of a simple SELECT query:
The is still in development and more features will be added in the future, if you want to do custom queries you can use the Database
class.
Middlewares
Middlewares are used to perform pre-processing logic on your application's request-response cycle. You can define a middleware in the constructor of your controller.
Views
MVCLite uses the Twig templating engine for separating logic from presentation in your views. You can create your views in the src/Views
directory and then render them in your controllers.
Twig
You can use the Twig templating engine to create your views. Here's an example of a simple Twig template:
Contributing
Feel free to contribute to MVCLite by submitting a pull request, opening an issue, or sharing your ideas for new features.
License
MVCLite is open-sourced software licensed under the MIT license.
Credits
MVCLite is maintained by belicfr
Thank you to all the contributors who have helped make MVCLite better :
- quentinformatique for the documentation and beta testing