3 namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Field;
5 use DrupalCodeGenerator\Command\BaseGenerator;
6 use DrupalCodeGenerator\Utils;
7 use Symfony\Component\Console\Input\InputInterface;
8 use Symfony\Component\Console\Output\OutputInterface;
11 * Implements d8:plugin:field:formatter command.
13 class Formatter extends BaseGenerator {
15 protected $name = 'd8:plugin:field:formatter';
16 protected $description = 'Generates field formatter plugin';
17 protected $alias = 'field-formatter';
22 protected function interact(InputInterface $input, OutputInterface $output) {
23 $questions = Utils::defaultPluginQuestions();
25 $vars = &$this->collectVars($input, $output, $questions);
26 $vars['class'] = Utils::camelize($vars['plugin_label'] . 'Formatter');
29 ->path('src/Plugin/Field/FieldFormatter/{class}.php')
30 ->template('d8/plugin/field/formatter.twig');
33 ->path('config/schema/{machine_name}.schema.yml')
34 ->template('d8/plugin/field/formatter-schema.twig')