Skip to content

Can I add controllers with class method #49

@lin-credible

Description

@lin-credible

Like this:

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions