Prechádzať zdrojové kódy

New Route Controller for generating previews

logicp 7 rokov pred
rodič
commit
5dbb4ce68e

+ 27 - 0
src/Controller/StatusPreviewController.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace Drupal\statusmessage\Controller;
+
+use Drupal\Core\Controller\ControllerBase;
+
+/**
+ * Class StatusPreviewController.
+ *
+ * @package Drupal\statusmessage\Controller
+ */
+class StatusPreviewController extends ControllerBase {
+
+  /**
+   * Generate.
+   *
+   * @return string
+   *   Return Hello string.
+   */
+  public function generate() {
+    return [
+      '#type' => 'markup',
+      '#markup' => $this->t('Implement method: generate')
+    ];
+  }
+
+}

+ 8 - 0
statusmessage.routing.yml

@@ -7,3 +7,11 @@ statusmessage.status_form:
   requirements:
     _access: 'TRUE'
   
+
+statusmessage.status_preview_controller_generate:
+  path: '/statusmessage/generate/preview'
+  defaults:
+    _controller: '\Drupal\statusmessage\Controller\StatusPreviewController::generate'
+    _title: 'Preview Generator'
+  requirements:
+    _permission: 'access content'