-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoc.module
53 lines (48 loc) · 1.26 KB
/
poc.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* @file
* Primary module hooks for poc module.
*
* @DCG
* This file is no longer required in Drupal 8.
* @see https://www.drupal.org/node/2217931
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function poc_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.poc':
return t('
<h2>Proof-of-concept module.</h2>
<p>This module\'s sole purpose is to test hos drupal handles composer dependencies.</p>
<p>It provides two components: A Kaomoji block, and a token generator page.</p>
<p>The Kaomoji block simply uses a separate service to return a random Kaomoji for you to put wherever you like.</p>
<p>The Token page allows you to set a length (and alphabet) and generate a token based on those parameters.</p>
');
}
return NULL;
}
/**
* Implements hook_theme().
*/
function poc_theme($existing, $type, $theme, $path) {
return [
'kaomoji' => [
'variables' => [
'kaomoji' => NULL,
],
'template' => 'kaomoji',
],
'kaomoji-app' => [
'template' => 'kaomojiApp',
],
'token' => [
'variables' => [
'token' => NULL,
],
'template' => 'token',
],
];
}