init without trunk
This commit is contained in:
parent
ed24ac4994
commit
bb809e7233
14652 changed files with 177862 additions and 94817 deletions
40
vendor/sensio/generator-bundle/Resources/skeleton/command/Command.php.twig
vendored
Normal file
40
vendor/sensio/generator-bundle/Resources/skeleton/command/Command.php.twig
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace {{ namespace }}\Command;
|
||||
|
||||
{% block use_statements %}
|
||||
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
{% endblock use_statements %}
|
||||
|
||||
{% block class_definition %}
|
||||
class {{ class_name }} extends ContainerAwareCommand
|
||||
{% endblock class_definition %}
|
||||
{
|
||||
{% block class_body %}
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('{{ name }}')
|
||||
->setDescription('...')
|
||||
->addArgument('argument', InputArgument::OPTIONAL, 'Argument description')
|
||||
->addOption('option', null, InputOption::VALUE_NONE, 'Option description')
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$argument = $input->getArgument('argument');
|
||||
|
||||
if ($input->getOption('option')) {
|
||||
// ...
|
||||
}
|
||||
|
||||
$output->writeln('Command result.');
|
||||
}
|
||||
|
||||
{% endblock class_body %}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue