I'm trying to use zend console and followed the documentation on their site. This is my code.
module.config.php
"router" => [
"routes" => [
"companies" => [
"type" => "segment",
"options" => [
"route" => "/companies[/:action[/:id]]",
"constraints" => [
"action" => "[a-zA-Z][a-zA-Z0-9_-]*",
"id" => "[0-9]*",
],
"defaults" => [
"controller" => Controller\CompaniesController::class,
"action" => "index",
],
],
],
],
],
"console" => [
"router" => [
"routes" => [
"abc1" => [
"options" => [
"route" => "abc1",
"defaults" => [
"controller" => Controller\Console::class,
"action" => "abc",
],
],
],
],
],
],
My controller
public function abcAction() {
$request = $this->getRequest();
if (! $request instanceof ConsoleRequest) {
throw new RuntimeException("You can only use this action from a console!");
}
return "Done! abc.\n";
}
When I do php public/index.php abc1
it does nothing. shows nothing. am I missing any config?