Parcourir la source

New Route Controller for generating previews

logicp il y a 7 ans
Parent
commit
5dbb4ce68e
2 fichiers modifiés avec 35 ajouts et 0 suppressions
  1. 27 0
      src/Controller/StatusPreviewController.php
  2. 8 0
      statusmessage.routing.yml

+ 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'