Very Thin, no-framework PHP

0.1 2017-11-14 10:49 UTC

This package is not auto-updated.

Last update: 2024-12-22 05:55:26 UTC


README

Simple, very thin, no-framework PHP.

Install

Via composer

composer require ideationnet/wafer

Usage

The simplest way to use this is to create an "invokable":

<?php
use Zend\Diactoros\Response\HtmlResponse;
class Hello
{    
    public function __invoke()
    {
        return new HtmlResponse('Hello!');
    }
}

And then just run it by creating an index.php:

<?php

use IdNet\Wafer\Application;
use Example\Hello;

require __DIR__.'/../vendor/autoload.php';

Application::run([

    'routes' => [
      ['GET', '/', Hello::class]
    ]

]);