3 namespace DrupalCodeGenerator\Command\Drupal_8\Plugin;
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:rest-resource command.
13 class RestResource extends BaseGenerator {
15 protected $name = 'd8:plugin:rest-resource';
16 protected $description = 'Generates rest resource plugin';
17 protected $alias = 'rest-resource';
18 protected $label = 'REST resource';
23 protected function interact(InputInterface $input, OutputInterface $output) {
24 $questions = Utils::defaultPluginQuestions();
26 $vars = &$this->collectVars($input, $output, $questions);
27 $vars['class'] = Utils::camelize($vars['plugin_label'] . 'Resource');
30 ->path('src/Plugin/rest/resource/{class}.php')
31 ->template('d8/plugin/rest-resource.twig');