tipsyphp / tipsy

An MVW PHP micro framework
http://tipsy.la
MIT License
60 stars 10 forks source link

Can I add controllers with class method #49

Open lin-credible opened 8 years ago

lin-credible commented 8 years ago

Like this:

class Greeting {
    public static function hello() {
        echo 'Hi, Typsy!';
    }
}

$tipsy->router()->when([
    'route' => '/',
    'method' => 'get',
    'controller' => array('Greeting', 'hello')
]);