PHPackages                             colibri/colibri - 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. colibri/colibri

AbandonedArchivedLibrary[Framework](/categories/framework)

colibri/colibri
===============

Colibri, the tiny (M)VC PHP framework

1111[1 issues](https://github.com/wadmiraal/Colibri/issues)[1 PRs](https://github.com/wadmiraal/Colibri/pulls)PHP

Since Feb 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/wadmiraal/Colibri)[ Packagist](https://packagist.org/packages/colibri/colibri)[ RSS](/packages/colibri-colibri/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Colibri, the tiny PHP (M)VC Framework
=====================================

[](#colibri-the-tiny-php-mvc-framework)

Colibri is a (really) small, but fully functional (M)VC framework. It's meant for small projects or quickly bootstrapping web applications.

As most of the core is the routing functionality (see **Controlers** below), it can also serve as a basis for your own, custom MVC framework.

Colibri is licensed under the MIT licence.

SHOULD YOU USE THIS ?
---------------------

[](#should-you-use-this-)

Probably not. It was an experiment, a simple proof-of-concept. I did use it in production, and it works very well. But, there are so many better alternatives out there ([Silex](http://silex.sensiolabs.org/) is my personal favorite).

It's what prompted me to write [this blog post](http://wadmiraal.net/lore/2013/02/26/go-make-your-own-bloody-framework/).

So, if you want to use it, go ahead. It's dead-simple, works very well, and is unit tested.

But, I don't recommend it :-).

Philosophy
----------

[](#philosophy)

Colibri makes no assumption about your workflow, nor does it restrict you in any way (except the template engine - more on that below). This means that it lacks many functionalities found in (much) larger frameworks like Symfony or Zend. But it also means that you can program your application the way *you* want.

### Directory structure

[](#directory-structure)

The Colibri core is located in the `sys` folder. The `web` and `app` folders are just examples and are not mandatory. The only thing you need to use Colibri is to a `COLIBRI_SYS_PATH` constant to point to the `sys` folder (you can rename this folder if you want), include the `Colibri.php` file and pass the path to the `conf.php` file to the `Colibri()` constructor. After that, you're good to code away !

### Template engine

[](#template-engine)

PHP comes bundled with a great, efficient and easy template-engine: PHP itself. Colibri simply uses php code to parse your template files and insert the data. Here again, Colibri enforces very little. By default, it will use a *layout* (which could be thought of as the HTML wrapper of your content) to which is passed a `$view` variable. This `$view`variable itself contains string data from a *view*.

If you've used *partials* before, then this will look familiar.

Views and layouts are simply PHP files with HTML. You can output any variables you want (iow: name the variables as you see fit in each file).

For convenience, 3 pre-defined variables will be available for the *layouts*: `$stylesheets`, `$scripts` and `$view`. `$stylesheets` and `$scripts` will be populated by calling the `$this->view->add_css()` or `$this->view->add_js()` methods in controllers, but this is not mandatory.

#### Partials ?

[](#partials-)

You can use Views just as partials. Just call `$my_view->partial()` to disable passing the view through a layout. This will allow you to have views nested within each other, giving great flexibility. You can use as many views as you want, each linked to a particular template file.

#### AJAX ?

[](#ajax-)

A view can also be rendered as JSON. By calling `$this->view->json()`, the template engine will skip the template parsing and directly output all variables as a JSON string. This is super-easy and very usefull for AJAX heavy applications.

Models
------

[](#models)

Colibri does not provide any models by default. Each application is unique, so it's your job to provide the model logic.

Views
-----

[](#views)

A view in Colibri is simply a file containing both HTML and PHP code. By default, all view files have a *.phtml* file extension, but this can be set to any extension you want in the `app/conf.php` file.

Controllers
-----------

[](#controllers)

All controllers should extend the `Colibri\Controller` class. All public methods with no prefixing underscore will be considered "callable" and can be mapped to in the url. Colibri uses the standard `controller/method/param1/param2/.../paramN` paradigm for routing the requests. Each parameter is then passed, in the same order, to the class method.

Helper functions
----------------

[](#helper-functions)

There are a few helper functions that are globally available.

`Colibri\conf()` retrieves values from the configuration file.

`Colibri\url()` makes it easier to format internal links for your application.

`Colibri\go_to()` redirects the current request. It uses the same parameters as `url()`.

`Colibri\segment()` will return the requested segment from the URI (e.g.: for `controller/method/param1`, `segment(1)` will return *method* - this is also true for i18n applications: `fr/controller/method/param1`, `segment(1)` will still return *method*).

`Colibri\language()` will return the current language in i18n enabled applications.

i18n out of the box
-------------------

[](#i18n-out-of-the-box)

Colibri can route requests for localized applications be prepending a language parameter to all URIs. This *language* parameter can be anything you want, and it's up to you to implement the localization or internationalization logic for your application. For example, these are all valid: en/controller/method fr-FR/controller/method ITA/controller/method

If a default language is set, all URIs with no language parameter will be considered of the default language (see `language()` above).

Use the `conf.php` file to configure your i18n settings. It's as easy as setting a variable to `TRUE`: no complex configuration or hacks. It just works.

SEO friendly
------------

[](#seo-friendly)

Colibri is SEO-friendly. The default .htaccess file provides URL rewriting instructions for Apache servers to remove the `index.php` from the request (`controller/method/param1` instead of `index.php/controller/method/param1`).

All class names and methods are made *URI-friendly* by replacing underscores with hyphens and lowercasing all segments (except the language parameter - see above).

### Requirements

[](#requirements)

Colibri requires PHP 5.3 or higher.

### Configuration

[](#configuration)

Configuration directives are found in `app/conf.php` and are pretty self-explainatory. As mentioned in **Directory structure** above, you are not bound to the provided directory structure. You can use any structure you want, just as long as all Colibri core files are located in the same directory.

In the provided directory structure, the `web` directory is the webroot. Colibri code is located outside the web root by default (recommended). If you don't want to place your code outside the webroot, move the `app` and `sys` directories in the same directory as `index.php`. Open `index.php` and change the `COLIBRI_SYS_PATH` constant to point where the Colibri core files reside (`sys` folder).

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d57d60420981f73d02cee32cd54ba27814a8c63dd15e92de3e92f7fae38e494?d=identicon)[wadmiraal](/maintainers/wadmiraal)

---

Top Contributors

[![wadmiraal](https://avatars.githubusercontent.com/u/745643?v=4)](https://github.com/wadmiraal "wadmiraal (1 commits)")

### Embed Badge

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

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

###  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)
