
| Current Path : /var/www/html/vendor/chi-teck/drupal-code-generator/src/Command/Misc/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/vendor/chi-teck/drupal-code-generator/src/Command/Misc/HtmlPage.php |
<?php declare(strict_types=1);
namespace DrupalCodeGenerator\Command\Misc;
use DrupalCodeGenerator\Application;
use DrupalCodeGenerator\Command\Generator;
/**
* Implements misc:html-page command.
*/
final class HtmlPage extends Generator {
protected string $name = 'misc:html-page';
protected string $description = 'Generates a simple html page';
protected string $alias = 'html-page';
protected string $label = 'HTML page';
protected string $templatePath = Application::TEMPLATE_PATH . '/misc/html-page';
/**
* {@inheritdoc}
*/
protected function generate(array &$vars): void {
$vars['file_name'] = $this->ask('File name', 'index.html');
$this->addFile('{file_name}', 'index');
$this->addFile('css/main.css')
->content("body{\n background-color: #EEE;\n}\n");
$this->addFile('js/main.js')
->content("console.log('It works!');\n");
}
}