I'm trying to access a function from my controller, using the console. It's a small application, so i only have one controller, 'IndexController'. The action i'm trying to reach is the 'buildSchemeAction'.
As i understand, you have to add routes in your "module.config.php" file, which i did as followed :
'console' => array (
'router' => array (
'routes' => array (
'build-scheme' => array (
'options' => array (
'route' => 'build-scheme',
'defaults' => array (
'controller' => 'Application\Controller\Index',
'action' => 'build-scheme'
public function buildSchemeAction()
// logic here
php index.php build-scheme
Zend Framework 2.2.5 application
Reason for failure: Invalid arguments or no arguments provided
I just found out why it didn't work. I had my console routes at the top of my module.config file, while this was at the very bottom :
// Placeholder for console routes 'console' => array( 'router' => array( 'routes' => array( ../ ), ), ),
Totally overlooked it, since it was there by default.