public function CommonTestController::themeLinkActiveClass

Returns links to the current page, with and without query strings.

Using #theme causes these links to be rendered with theme_link().

1 string reference to 'CommonTestController::themeLinkActiveClass'
common_test.routing.yml in drupal/core/modules/system/tests/modules/common_test/common_test.routing.yml
drupal/core/modules/system/tests/modules/common_test/common_test.routing.yml

File

drupal/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php, line 67
Contains \Drupal\common_test\Controller\CommonTestController.

Class

CommonTestController
Controller routines for common_test routes.

Namespace

Drupal\common_test\Controller

Code

public function themeLinkActiveClass() {
  return array(
    'no_query' => array(
      '#theme' => 'link',
      '#text' => t('Link with no query string'),
      '#path' => current_path(),
    ),
    'with_query' => array(
      '#theme' => 'link',
      '#text' => t('Link with a query string'),
      '#path' => current_path(),
      '#options' => array(
        'query' => array(
          'foo' => 'bar',
          'one' => 'two',
        ),
      ),
    ),
    'with_query_reversed' => array(
      '#theme' => 'link',
      '#text' => t('Link with the same query string in reverse order'),
      '#path' => current_path(),
      '#options' => array(
        'query' => array(
          'one' => 'two',
          'foo' => 'bar',
        ),
      ),
    ),
  );
}