PHP code example of dartmoon / prestashop-console
1. Go to this page and download the library: Download dartmoon/prestashop-console library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dartmoon / prestashop-console example snippets
namespace Dartmoon\MyModule\Commands;
use Dartmoon\Console\AbstractCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class HelloWorldCommand extends AbstractCommand
{
/**
* Name and description
*/
protected $name = 'mymodule:hello-world';
/**
* Command description
*/
protected $description = 'Simple command that says Hello Wold!';
/**
* Execute command
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
echo "Hello World!";
}
}
bash
php bin/console mymodule:hello-world