I have a console route in my module.config.php file
'console' => [
'router' => [
'routes' => [
'remove' => [
'type' => 'simple',
'options' => [
'route' => 'remove [force] [init]',
'defaults' => [
'controller' => Controller\CliController::class,
'action' => 'remove',
],
],
]
]
]
]
And my Controller that has method removeAction()
namespace Controller;
class CliController extends AbstractActionController
{
public function removeAction()
{
$this->logger->debug('I am in');
}
}
When i do command php public/index.php remove force
or php public/index.php remove
I never get sent to do controller and there is no error or any output. So am I doing the matching wrong?
It's like app is not realizing it was called from terminal. Sometimes it just returns html
if i remove getConfig
method from Module.php
within my module/MyModulefolder
.