class TourTestController

Same name in other branches
  1. 9 core/modules/tour/tests/tour_test/src/Controller/TourTestController.php \Drupal\tour_test\Controller\TourTestController
  2. 10 core/modules/tour/tests/tour_test/src/Controller/TourTestController.php \Drupal\tour_test\Controller\TourTestController
  3. 11.x core/modules/tour/tests/tour_test/src/Controller/TourTestController.php \Drupal\tour_test\Controller\TourTestController

Controller routines for tour_test routes.

Hierarchy

Expanded class hierarchy of TourTestController

File

core/modules/tour/tests/tour_test/src/Controller/TourTestController.php, line 8

Namespace

Drupal\tour_test\Controller
View source
class TourTestController {
    
    /**
     * Outputs some content for testing tours.
     *
     * @param string $locale
     *   (optional) Dummy locale variable for testing routing parameters. Defaults
     *   to 'foo'.
     *
     * @return array
     *   Array of markup.
     */
    public function tourTest1($locale = 'foo') {
        return [
            'tip-1' => [
                '#type' => 'container',
                '#attributes' => [
                    'id' => 'tour-test-1',
                ],
                '#children' => t('Where does the rain in Spain fail?'),
            ],
            'tip-3' => [
                '#type' => 'container',
                '#attributes' => [
                    'id' => 'tour-test-3',
                ],
                '#children' => t('Tip created now?'),
            ],
            'tip-4' => [
                '#type' => 'container',
                '#attributes' => [
                    'id' => 'tour-test-4',
                ],
                '#children' => t('Tip created later?'),
            ],
            'tip-5' => [
                '#type' => 'container',
                '#attributes' => [
                    'class' => [
                        'tour-test-5',
                    ],
                ],
                '#children' => t('Tip created later?'),
            ],
            'code-tip-1' => [
                '#type' => 'container',
                '#attributes' => [
                    'id' => 'tour-code-test-1',
                ],
                '#children' => t('Tip created now?'),
            ],
        ];
    }
    
    /**
     * Outputs some content for testing tours.
     */
    public function tourTest2() {
        return [
            '#type' => 'container',
            '#attributes' => [
                'id' => 'tour-test-2',
            ],
            '#children' => t('Pangram example'),
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary
TourTestController::tourTest1 public function Outputs some content for testing tours.
TourTestController::tourTest2 public function Outputs some content for testing tours.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.