TourTestController.php 2 KB
Newer Older
1
2
3
4
5
6
7
8
<?php
/**
 * @file
 * Contains \Drupal\tour_test\Controller\TourTestController.
 */

namespace Drupal\tour_test\Controller;

9
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
10
11
12
13
14
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Controller routines for tour_test routes.
 */
15
class TourTestController implements ContainerInjectionInterface {
16
17
18
19
20
21
22
23
24
25

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static();
  }

  /**
   * Outputs some content for testing tours.
26
27
28
29
30
31
32
   *
   * @param string $locale
   *  (optional) Dummy locale variable for testing routing parameters. Defaults
   *   to 'foo'.
   *
   * @return array
   *   Array of markup.
33
   */
34
  public function tourTest1($locale = 'foo') {
35
36
37
38
39
40
41
42
    return array(
      'tip-1' => array(
        '#type' => 'container',
        '#attributes' => array(
          'id' => 'tour-test-1',
        ),
        '#children' => t('Where does the rain in Spain fail?'),
      ),
43
44
45
46
47
48
49
      'tip-3' => array(
        '#type' => 'container',
        '#attributes' => array(
          'id' => 'tour-test-3',
        ),
        '#children' => t('Tip created now?'),
      ),
50
51
52
53
54
55
56
      'tip-4' => array(
        '#type' => 'container',
        '#attributes' => array(
          'id' => 'tour-test-4',
        ),
        '#children' => t('Tip created later?'),
      ),
57
58
59
60
61
62
63
64
65
66
67
68
69
70
      'tip-5' => array(
        '#type' => 'container',
        '#attributes' => array(
          'class' => 'tour-test-5',
        ),
        '#children' => t('Tip created later?'),
      ),
      'code-tip-1' => array(
        '#type' => 'container',
        '#attributes' => array(
          'id' => 'tour-code-test-1',
        ),
        '#children' => t('Tip created now?'),
      ),
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    );
  }

  /**
   * Outputs some content for testing tours.
   */
  public function tourTest2() {
    return array(
      '#type' => 'container',
      '#attributes' => array(
        'id' => 'tour-test-2',
      ),
      '#children' => t('Pangram example'),
    );

  }

}