PHPackages                             belicfr/mvclite - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. belicfr/mvclite

ActiveProject[Framework](/categories/framework)

belicfr/mvclite
===============

1.1.2(2y ago)312[1 issues](https://github.com/belicfr/MVCLite/issues)MITPHP

Since Jan 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/belicfr/MVCLite)[ Packagist](https://packagist.org/packages/belicfr/mvclite)[ RSS](/packages/belicfr-mvclite/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (16)Used By (0)

[![](src/Resources/Medias/logo.png)](src/Resources/Medias/logo.png)

About MVCLite
=============

[](#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
--------

[](#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
------------

[](#installation)

You can install *MVCLite* via **Composer**. Run the following command in your terminal:

```
composer create-project belicfr/mvclite
```

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.

```
const ROUTE_PATH_PREFIX = '/';

const DATABASE_CREDENTIALS = [

    "dbms"      =>  "mysql",

    "host"      =>  "localhost",
    "port"      =>  "3306",
    "charset"   =>  "utf8mb4",
    "name"      =>  "",
    "user"      =>  "",
    "password"  =>  ""

];
```

You also have to configure the **htaccess** file, you can use the `.htaccess_example` file as a base.

```
RewriteEngine On
RewriteBase /website/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !src/resources/(.*)$

RewriteRule ^(.*)$ index.php?route=$1 [QSA,L]
```

Usage
-----

[](#usage)

### Router

[](#router)

Define your application's **routes** in the `src/Router/routes.php` file. Here's an example of a simple route:

```
Router::get('/path', Controller::class, "method");
```

You can also define **routes** with a custom name

```
Router::get('/path', Controller::class, "method")->setName('routeName');
```

### ORM

[](#orm)

The build-in **ORM** allows you to interact with your database. Here's an example of a simple **SELECT** query:

```
Model::select('column1', 'column2')
       ->where('column', 'value')
       ->orderBy('column', 'ASC')
       ->execute();
```

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.

```
Database::query('INSERT INTO table (column1, column2) VALUES (?, ?)', ['value1', 'value2']);
```

### Middlewares

[](#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.

```
public function __construct()
{
    $this->middleware(AuthMiddleware::class);
}
```

### Views

[](#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**.

```
View::render('View', ['data' => $data]);
```

### Twig

[](#twig)

You can use the **Twig** templating engine to create your views. Here's an example of a simple **Twig** template:

```

    {{ title }}

{% if bool %}
    {{ content1 }}
{% else %}
    {{ content2 }}
{% endif %}
{{ include('Footer.twig', {'data': data}) }}

```

Contributing
------------

[](#contributing)

Feel free to contribute to *MVCLite* by submitting a **pull request**, opening an **issue**, or sharing your ideas for new **features**.

License
-------

[](#license)

*MVCLite* is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Credits
-------

[](#credits)

*MVCLite* is maintained by [belicfr](https://github.com/belicfr)

Thank you to all the contributors who have helped make *MVCLite* better :

- [quentinformatique](https://github.com/quentinformatique) for the documentation and beta testing

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Recently: every ~9 days

Total

13

Last Release

769d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63759e9c0ea929d8ce7dc4fcee22f3d8d6e436823880e354812e9894c49ac84d?d=identicon)[belicfr](/maintainers/belicfr)

---

Top Contributors

[![belicfr](https://avatars.githubusercontent.com/u/96206878?v=4)](https://github.com/belicfr "belicfr (285 commits)")[![quentinformatique](https://avatars.githubusercontent.com/u/80545291?v=4)](https://github.com/quentinformatique "quentinformatique (3 commits)")

---

Tags

ajaxajax-formajax-requestapachebackendcomposerframeworkfrontendhtmlhtml-csshtml-css-javascripthtml5javascriptjsnodejsphpphp8serverwebwebsite

### Embed Badge

![Health badge](/badges/belicfr-mvclite/health.svg)

```
[![Health](https://phpackages.com/badges/belicfr-mvclite/health.svg)](https://phpackages.com/packages/belicfr-mvclite)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
