minibase/minibase

Minimal extensible framework for PHP - done right.

v1.0.0-alpha 2013-04-17 23:44 UTC

This package is auto-updated.

Last update: 2024-04-29 03:10:00 UTC


README

Build Status

Minibase (PHP 5.4+)

Minibase is a framework for RESTful PHP applications, based on Event Driven Architecture. Minibase is what a framework should do, it gives you a minimum base to extend on as you go. Plugins can be downloaded from anywhere and included easily.

Minibase is not fullstack, but with plugins it is.

For a fullstack framework see the Sample Minibase App. The sample app contains some architecture using best practices and includes some plugins to show the capabilities of Minibase.

Configurable

We use JSON for configuration files, because its known, easy and good performance. You can create a routes.json file and put your route binding there. You can create a app.json file and put app configuration there. For those who likes the programmatic way of binding these things you don't have to use configuration files.

Extensible

Minibase uses event based architecture with a simple on / trigger system. Using Minibase Plugin system along with the Events makes it easy to create standalone plugins.

Event based architecture makes this framework stand out, all kinds of plugins can be created. Also it's easy. Take a look at 3rdparty plugins to see some plugins that are already created for those who are looking for forexample Twig templating engine, and Doctrine ORM support.

Install

You can install Minibase with Composer, if you are not using composer, start using it.

  1. Install composer.
  2. Create composer.json and put a require dependency.
{
    "require": {
        "minibase/minibase": "dev-master"
    }
}
  1. Run composer install

Documentation.

  • Minibase: Configure the Minibase object.
  • Routing: See how to do routing, reverse routing and such.
  • Events: Minibase events, listen to these to extend minibase.
  • Commandline: Minibase includes symfony CLI, CLI and also be extended with custom commands.
  • Plugins: Create your own plugins publish them to composer and share.
  • 3rdparty plugins: Browse plugins to extend minibase.
  • Internationalization: I18n for your apps with gettext. Full workflow control.
  • Assetic: Manage your assets!

Simple (if you want)

If you really want no OO-code you can create your apps really fast. Note, there are also OO-way of routing using Controller.method approach. See more about Routing.

Creating your app in ~11 lines of code

	require 'vendor/autoload.php'; // Include composer autoloader

	$mb = \Minibase\MB::create(); // Create one application object.
	
	// Add a route for your homepage
	$mb->route("get", "/", function () {
		// some logic.
		// And return a HtmlResponse object
		return $this->respond("html")->view("views/test.html.php");
	});
	
	// Start the router engine.
	$mb->start();