Mercurial > hg > cmmr2012-drupal-site
annotate vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/ThemeInfo.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | c75dbcec494b |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace DrupalCodeGenerator\Command\Drupal_7; |
Chris@0 | 4 |
Chris@0 | 5 use DrupalCodeGenerator\Command\BaseGenerator; |
Chris@0 | 6 use DrupalCodeGenerator\Utils; |
Chris@0 | 7 use Symfony\Component\Console\Input\InputInterface; |
Chris@0 | 8 use Symfony\Component\Console\Output\OutputInterface; |
Chris@0 | 9 use Symfony\Component\Console\Question\Question; |
Chris@0 | 10 |
Chris@0 | 11 /** |
Chris@0 | 12 * Implements d7:theme-info command. |
Chris@0 | 13 */ |
Chris@0 | 14 class ThemeInfo extends BaseGenerator { |
Chris@0 | 15 |
Chris@0 | 16 protected $name = 'd7:theme-info'; |
Chris@0 | 17 protected $description = 'Generates info file for a Drupal 7 theme'; |
Chris@0 | 18 protected $label = 'Info (theme)'; |
Chris@0 | 19 |
Chris@0 | 20 /** |
Chris@0 | 21 * {@inheritdoc} |
Chris@0 | 22 */ |
Chris@0 | 23 protected function interact(InputInterface $input, OutputInterface $output) { |
Chris@0 | 24 $questions['name'] = new Question('Theme name'); |
Chris@0 | 25 $questions['name']->setValidator([Utils::class, 'validateRequired']); |
Chris@0 | 26 $questions['machine_name'] = new Question('Theme machine name'); |
Chris@0 | 27 $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); |
Chris@0 | 28 $questions['description'] = new Question('Theme description', 'A simple Drupal 7 theme.'); |
Chris@0 | 29 $questions['base_theme'] = new Question('Base theme'); |
Chris@0 | 30 |
Chris@0 | 31 $this->collectVars($input, $output, $questions); |
Chris@0 | 32 |
Chris@0 | 33 $this->addFile() |
Chris@0 | 34 ->path('{machine_name}.info') |
Chris@0 | 35 ->template('d7/theme-info.twig'); |
Chris@0 | 36 } |
Chris@0 | 37 |
Chris@0 | 38 } |