Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / Yml / Routing.php
1 <?php
2
3 namespace DrupalCodeGenerator\Command\Drupal_8\Yml;
4
5 use DrupalCodeGenerator\Command\BaseGenerator;
6 use DrupalCodeGenerator\Utils;
7 use Symfony\Component\Console\Input\InputInterface;
8 use Symfony\Component\Console\Output\OutputInterface;
9
10 /**
11  * Implements d8:yml:routing command.
12  */
13 class Routing extends BaseGenerator {
14
15   protected $name = 'd8:yml:routing';
16   protected $description = 'Generates a routing yml file';
17   protected $alias = 'routing';
18
19   /**
20    * {@inheritdoc}
21    */
22   protected function interact(InputInterface $input, OutputInterface $output) {
23     $questions = Utils::defaultQuestions();
24
25     $vars = &$this->collectVars($input, $output, $questions);
26     $vars['class'] = Utils::camelize($vars['machine_name']) . 'Controller';
27
28     $this->addFile()
29       ->path('{machine_name}.routing.yml')
30       ->template('d8/yml/routing.twig');
31   }
32
33 }