Mercurial > hg > cmmr2012-drupal-site
annotate vendor/chi-teck/drupal-code-generator/src/Command/Drupal_7/TemplatePhp.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:template.php command. |
Chris@0 | 13 */ |
Chris@0 | 14 class TemplatePhp extends BaseGenerator { |
Chris@0 | 15 |
Chris@0 | 16 protected $name = 'd7:template.php'; |
Chris@0 | 17 protected $description = 'Generates Drupal 7 template.php file'; |
Chris@0 | 18 protected $alias = 'template.php'; |
Chris@0 | 19 protected $label = 'template.php'; |
Chris@0 | 20 |
Chris@0 | 21 /** |
Chris@0 | 22 * {@inheritdoc} |
Chris@0 | 23 */ |
Chris@0 | 24 protected function interact(InputInterface $input, OutputInterface $output) { |
Chris@0 | 25 $questions['name'] = new Question('Theme name'); |
Chris@0 | 26 $questions['name']->setValidator([Utils::class, 'validateRequired']); |
Chris@0 | 27 $questions['machine_name'] = new Question('Theme machine name'); |
Chris@0 | 28 $questions['machine_name']->setValidator([Utils::class, 'validateMachineName']); |
Chris@0 | 29 |
Chris@0 | 30 $this->collectVars($input, $output, $questions); |
Chris@0 | 31 |
Chris@0 | 32 $this->addFile() |
Chris@0 | 33 ->path('template.php') |
Chris@0 | 34 ->template('d7/template.php.twig'); |
Chris@0 | 35 } |
Chris@0 | 36 |
Chris@0 | 37 } |