zfcampus / zf-console

Create console applications in PHP
BSD 3-Clause "New" or "Revised" License
64 stars 25 forks source link

Allow setting handler in route configuration #7

Closed weierophinney closed 10 years ago

weierophinney commented 10 years ago

If the handler for a given command can be expressed as a string or array callable (e.g., a function name, a static method name, a class name of a class that is invokable), we should allow specifying the handler as part of the route configuration, in order to keep the associations in one place.

return array(
    array(
        'name' => 'build',
        'route' => '<package> [--target=]`,
        'handler' => 'ZF\Deploy\Deploy`,
    ),
);

Application's constructor would need to be altered to allow the following: