3 namespace DrupalCodeGenerator\Command\Drupal_8;
5 use DrupalCodeGenerator\Command\BaseGenerator;
6 use DrupalCodeGenerator\Utils;
7 use Symfony\Component\Console\Input\InputInterface;
8 use Symfony\Component\Console\Output\OutputInterface;
9 use Symfony\Component\Console\Question\Question;
12 * Implements d8:theme-file command.
14 class ThemeFile extends BaseGenerator {
16 protected $name = 'd8:theme-file';
17 protected $description = 'Generates a theme file';
18 protected $alias = 'theme-file';
19 protected $destination = 'themes/%';
24 protected function interact(InputInterface $input, OutputInterface $output) {
25 $questions['name'] = new Question('Theme name');
26 $questions['name']->setValidator([Utils::class, 'validateRequired']);
27 $questions['machine_name'] = new Question('Theme machine name');
28 $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']);
30 $this->collectVars($input, $output, $questions);
33 ->path('{machine_name}.theme')
34 ->template('d8/theme.twig');