vindite/vindite

simple microframework

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

dev-master 2019-04-26 21:02 UTC

README

Vindite is a PHP micro-framework that helps you quickly write simple web applications.

Installation

It's recommended that you use Composer to install Vindite.

$ composer require vindite/vindite "dev-master@dev"

This will install Vindite and all required dependencies. Vindite requires PHP 7.2 or newer.

Usage

Create an index.php file with the following contents:

<?php

require 'vendor/autoload.php';

$app = Vindite\App::getInstance();

$app->route()->middleware([
    new Vindite\Middleware\Handler\Auth,
    new Vindite\Middleware\Handler\Session
])->group(function () use ($app) {

    $app->route()->get('/hello/{name}', function ($argument) use ($app) {
        return $app->json("Hello, {$argument['name']}");
    });

    $app->route()->get('/', 'HomeController@index');
    $app->route()->post('/store', 'HomeController@store');
    $app->route()->put('/put/{id}', 'HomeController@put');
    $app->route()->delete('/delete/{id}', 'HomeController@delete');
})->run();

Examples

Please see https://github.com/vindite/vindite-skeleton for more examples.

Credits

License

The Vindite Microframework is licensed under the MIT license. See License File for more information.