Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Console\App\Commands;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Input\InputArgument;
- class HelloworldCommand extends Command
- {
- protected function configure()
- {
- $this->setName('hello-world')
- ->setDescription('Prints Hello-World!')
- ->setHelp('Demonstration of custom commands created by Symfony Console component.')
- ->addArgument('username', InputArgument::REQUIRED, 'Pass the username.');
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $output->writeln(sprintf('Hello World!, %s', $input->getArgument('username')));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement