
| Current Path : /var/www/html/store1/vendor/chi-teck/drupal-code-generator/src/Command/Plugin/Views/ |
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/store1/vendor/chi-teck/drupal-code-generator/src/Command/Plugin/Views/Style.php |
<?php declare(strict_types=1);
namespace DrupalCodeGenerator\Command\Plugin\Views;
use DrupalCodeGenerator\Application;
use DrupalCodeGenerator\Command\Plugin\PluginGenerator;
/**
* Implements plugin:views:style command.
*/
final class Style extends PluginGenerator {
protected string $name = 'plugin:views:style';
protected string $description = 'Generates views style plugin';
protected string $alias = 'views-style';
protected string $templatePath = Application::TEMPLATE_PATH . '/plugin/views/style';
/**
* {@inheritdoc}
*/
protected function generate(array &$vars): void {
$this->collectDefault($vars);
$vars['configurable'] = $this->confirm('Make the plugin configurable?');
$this->addFile('src/Plugin/views/style/{class}.php')
->template('style');
$this->addFile('templates/views-style-{plugin_id|u2h}.html.twig')
->template('template');
$this->addFile('{machine_name}.module')
->headerTemplate('_lib/file-docs/module')
->template('preprocess')
->appendIfExists()
->headerSize(7);
if ($vars['configurable']) {
$this->addSchemaFile()->template('schema');
}
}
}