Go to file
Geoff Doty 2658600afe update docs/examples 2023-06-23 12:12:50 -05:00
examples update docs/examples 2023-06-23 12:12:50 -05:00
src added default path detection 2023-06-23 12:12:28 -05:00
tests Initial commit, part due 2018-12-09 03:04:11 -05:00
.gitignore Initial commit, part due 2018-12-09 03:04:11 -05:00
README.md update docs/examples 2023-06-23 12:12:50 -05:00
composer.json Initial commit, part due 2018-12-09 03:04:11 -05:00
phpunit.xml updated phpunit config 2018-12-09 03:16:46 -05:00

README.md

Mite

The tiniest framework that mite work

A word of warning, this is an experiment that I'm resurrecting, so it's quite dated atm


     /___\        ___ _
     )O.o(  |\/| o | |_   BE small
     \_^_/  |  | | | |_   be STRONG
      " "

Overview

Mite is a single-file framework that was born out of a necessity of its time, circa 2011, to enable rapid prototyping for PHP. When ideas came too fast to capture in most conventional frameworks for PHP, Mite provided a one-include-and-go solution.

This was also the first time I had the idea to break away from MVC structure and just build something based around routing. Turned out this idea was not mine alone, it started with sinatra.rb, and continued with express.js.

There are better options out there now

Features

Requirements

  • PHP 5.4+ ([], php -S)

Usage

Create an index.php file and put the following code in it


<?php require(PATH_TO_MITE);

class Prototype extends Mite {

    function index()
    {
        // *.tpl.* not required
        $this->view('index.tpl.php');
    }
}

$app = new Prototype();
$app->route('/', 'index');
$app->run();

The file name as index.php is important for routing

SEE: examples/

TODO

  • More Examples
  • Document API
  • Mite DB construct take PDO object, not build one
  • Support REST functionality