Mercurial > hg > cmmr2012-drupal-site
comparison vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ThemeInfo.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 | |
3 namespace DrupalCodeGenerator\Command\Drupal_7; | |
4 | |
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; | |
10 | |
11 /** | |
12 * Implements d7:theme-info command. | |
13 */ | |
14 class ThemeInfo extends BaseGenerator { | |
15 | |
16 protected $name = 'd7:theme-info'; | |
17 protected $description = 'Generates info file for a Drupal 7 theme'; | |
18 protected $label = 'Info (theme)'; | |
19 | |
20 /** | |
21 * {@inheritdoc} | |
22 */ | |
23 protected function interact(InputInterface $input, OutputInterface $output) { | |
24 $questions['name'] = new Question('Theme name'); | |
25 $questions['name']->setValidator([Utils::class, 'validateRequired']); | |
26 $questions['machine_name'] = new Question('Theme machine name'); | |
27 $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); | |
28 $questions['description'] = new Question('Theme description', 'A simple Drupal 7 theme.'); | |
29 $questions['base_theme'] = new Question('Base theme'); | |
30 | |
31 $this->collectVars($input, $output, $questions); | |
32 | |
33 $this->addFile() | |
34 ->path('{machine_name}.info') | |
35 ->template('d7/theme-info.twig'); | |
36 } | |
37 | |
38 } |