Skip to content

bgruszka/hiro

Repository files navigation

Hiro Framework

Build Status Code Climate

DI Container:

To config Dependency Injection Container place your dependencies in section container in the config.yml.

To define simple service in container:

request:
    class: 'Hiro\Request'

To inject defined service use the calls parameter:

router:
    class: 'Hiro\Router'
    calls: ['request']

To inject simple type use the arguments parameter:

db:
    class: 'Hiro\Db'
    arguments: ['sqlite:///tmp/db.sqlite']

Example routing:

$serviceContainer->router->addRoute('get', '/hello-world', function() {
    $currentUri = $this->request->getCurrentUri();
    $content = 'Hello World!';
    return new Hiro\Response($content);
});

About

PHP microframework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages