8e6e2e41c57fd00dfe470f8e90b6bc2c3d2de3b1
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Other / HtmlPage.php
1 <?php
2
3 namespace DrupalCodeGenerator\Command\Other;
4
5 use DrupalCodeGenerator\Command\BaseGenerator;
6 use Symfony\Component\Console\Input\InputInterface;
7 use Symfony\Component\Console\Output\OutputInterface;
8 use Symfony\Component\Console\Question\Question;
9
10 /**
11  * Implements other:html-page command.
12  */
13 class HtmlPage extends BaseGenerator {
14
15   protected $name = 'other:html-page';
16   protected $description = 'Generates a simple html page';
17   protected $alias = 'html-page';
18   protected $label = 'HTML page';
19   protected $destination = FALSE;
20
21   /**
22    * {@inheritdoc}
23    */
24   protected function interact(InputInterface $input, OutputInterface $output) {
25     $questions['file_name'] = new Question('File name', 'index.html');
26
27     $this->collectVars($input, $output, $questions);
28
29     $this->addFile()
30       ->path('{file_name}')
31       ->template('other/html.twig');
32
33     $this->addFile()
34       ->path('css/main.css')
35       ->content('body{background-color: #EEE}');
36
37     $this->addFile()
38       ->path('js/main.js')
39       ->content("console.log('It works!');");
40   }
41
42 }