Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An extremely lightweight PHP model-view-controller framework designed to make web application development quick and easy

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

ko - an extremely minimalistic PHP framework

ko is an attempt at a very minimalistic MVC framework designed to make developing simple PHP appliocations easily and efficiently. It has been heaviliy inspired by CodeIgniter, but I hope to include some ko-specific features as development blooms.

Models

Each user-created model has this generic template:

public class <model_name> extends ko_model
{
    public function __construct()
    {
        parent::__construct();
    }

    // insert custom functions here
}

Views

A view is mainly an HTML file. You can include whatever design you want, the flow is completely up to you.

When called from a constructor, a view will most likely have an array of variables passed to it, presumably grabbed using a model. You can access these variables using inline PHP to echo them out.

For example, say you've called the index view and sent it an array containing one variable, namely $title = "My Homepage". You can get this variable's contents in your view using the following method:

[ ... some HTML stuff here ... ]
<?php echo $_POST['title']; ?>
[ ... moar HTML! ...]

You can pass any number of variables to your views, all can be accessed using the method used above.

Controllers

Every user-created controller must have this general template:

public class <controller_name> extends ko_controller
{
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        // code to be executed when this controller is called
    }

    // more user-defined functions
}
Something went wrong with that request. Please try again.