Zend Framework 2 - Console usage a speed help

22 Aug 2013 · Less than one minute read · on Gianluca's blog

News! Tech related notes are NOW published to ShippingBytes. See you there! I always felt this was not the right place for me to write consistently about tech and tools. So if you want to read more about that see you at the other side

With Zend Framework is very easy to write a command line tool to manage different things. But what if there are more commands? How do you remeber them all?

<?php
namespace ModuleTest;
use Zend\Console\Adapter\AdapterInterface;
class Module {
	public function getConsoleUsage(AdapterInterface $console)
	{
		return array(
			array('test <params1> <params2> [--params=]', 'Description of test command'),
			array('run <action>', 'Start anction')
		);
	}
}

You can write this function in a Module.php file, and create a basic helper to help you see when you write a bad command.

English by Rali :smile: Thanks!!!! :smile:

Something weird with this website? Let me know.