Skip to content
Devin Smith edited this page Dec 8, 2015 · 3 revisions

The Tipsy app can be accessed either by it's static methods, object methods, or a combination of both.

Object

$t = new Tipsy\Tipsy;
$r->router()->home(function() {
    echo "it's good to be home";
});
$t->run();

Static

Tipsy\Tipsy::router()->home(function() {
    echo "it's good to be home";
});
Tipsy\Tipsy::run();

or

use Tipsy\Tipsy;
Tipsy::router()->home(function() {
    echo "it's good to be home";
});
Tipsy::run();

Combining both

You probably only need this if you are doing weird stuff.

use Tipsy\Tipsy;
$tipsy = Tipsy::app();
$tipsy->router()->home(function() {
    echo "it's good to be home";
});
Tipsy::run();