Mercurial > hg > cmmr2012-drupal-site
annotate vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Javascript.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_8; |
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 |
Chris@0 | 10 /** |
Chris@0 | 11 * Implements d8:javascript command. |
Chris@0 | 12 */ |
Chris@0 | 13 class Javascript extends BaseGenerator { |
Chris@0 | 14 |
Chris@0 | 15 protected $name = 'd8:javascript'; |
Chris@0 | 16 protected $description = 'Generates Drupal 8 JavaScript file'; |
Chris@0 | 17 protected $alias = 'javascript'; |
Chris@0 | 18 |
Chris@0 | 19 /** |
Chris@0 | 20 * {@inheritdoc} |
Chris@0 | 21 */ |
Chris@0 | 22 protected function interact(InputInterface $input, OutputInterface $output) { |
Chris@0 | 23 $vars = $this->collectVars($input, $output, Utils::defaultQuestions()); |
Chris@0 | 24 $this->addFile() |
Chris@0 | 25 ->path('js/' . str_replace('_', '-', $vars['machine_name']) . '.js') |
Chris@0 | 26 ->template('d8/javascript.twig'); |
Chris@0 | 27 } |
Chris@0 | 28 |
Chris@0 | 29 } |