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
diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Routing.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Yml/Routing.php
new file mode 100644 (file)
index 0000000..f0b2d25
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+namespace DrupalCodeGenerator\Command\Drupal_8\Yml;
+
+use DrupalCodeGenerator\Command\BaseGenerator;
+use DrupalCodeGenerator\Utils;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Implements d8:yml:routing command.
+ */
+class Routing extends BaseGenerator {
+
+  protected $name = 'd8:yml:routing';
+  protected $description = 'Generates a routing yml file';
+  protected $alias = 'routing';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function interact(InputInterface $input, OutputInterface $output) {
+    $questions = Utils::defaultQuestions();
+
+    $vars = &$this->collectVars($input, $output, $questions);
+    $vars['class'] = Utils::camelize($vars['machine_name']) . 'Controller';
+
+    $this->addFile()
+      ->path('{machine_name}.routing.yml')
+      ->template('d8/yml/routing.twig');
+  }
+
+}