Examples of usage

A simple base app execution

1
2
3
4
<?php
$app = new Application();

$app->run();

Execute with bootstrap

1
2
3
4
5
6
7
8
<?php
$app = new Application();

$app->bootstrap("say-hello", function(){
    return array('example' => 'ciao');
});

$app->run();

Into a controller

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?php
class IndexController extends Controller
{
    public function indexAction()
    {
        $element = $this->getResource('example');

        echo $element["example"];
    }
}

Controller Forward

You can pass to another controller using then()

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php
class IndexController extends Controller
{
    public function indexAction()
    {
        // Add forward action
        $this->then("/index/forward");
    }

    public function forwardAction()
    {
        // append to index or use it directly
    }
}

See example folder for a complete working example.