Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / templates / module / src / Ajax / ajax-command.php.twig
diff --git a/vendor/drupal/console/templates/module/src/Ajax/ajax-command.php.twig b/vendor/drupal/console/templates/module/src/Ajax/ajax-command.php.twig
new file mode 100644 (file)
index 0000000..2e59019
--- /dev/null
@@ -0,0 +1,33 @@
+{% extends "base/class.php.twig" %}
+
+{% block file_path %}
+\Drupal\{{ module }}\Ajax\{{ class_name }}.
+{% endblock %}
+
+{% block namespace_class %}
+namespace Drupal\{{ module }}\Ajax;
+{% endblock %}
+
+{% block use_class %}
+use Drupal\Core\Ajax\CommandInterface;
+{% endblock %}
+{% block class_declaration %}
+/**
+ * Class {{ class_name }}.
+ */
+class {{ class_name }} implements CommandInterface {% endblock %}
+
+{% block class_methods %}
+  /**
+   * Render custom ajax command.
+   *
+   * @return ajax
+   *   Command function.
+   */
+  public function render() {
+    return [
+      'command' => '{{ method }}',
+      'message' => 'My Awesome Message',
+    ];
+  }
+{% endblock %}