nigelgreenway/colonel

A component based framework on StackPHP with PHP League components

v0.4.1 2016-06-03 14:56 UTC

README

To use, simply add:

<?php

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

$app = (new Colonel\HttpKernel(
    require_once __DIR__ . '/../Application/Configuration.php'
))->run();

An example configuration file:

<?php

return [
    'debug'  => false,
    'routes' => [
        'DemoBundle' => [
            'hello_world' => [
                'pattern'    => '/your/pattern/{var}',
                'controller' => 'Path\\To\\Class::method',
                'method'     => 'GET',
            ],
        ],
    ],
    'services' => [
        'di' => [
            'Path\\To\\Some\\Dependency' => [
                'class' => 'Path\\To\\Some\\Dependency',
                'arguments' => [
                    'Path\\To\\Some\\Other\\Dependency',
                ],
            ],
            'Path\\To\\Some\\Other\\Dependency' => [
                'class' => 'Path\\To\\Some\\Other\\Dependency',
            ],
        ],
    ],
];

This will be fleshed more out soon...