You are here

public function CommonTestController::jsAndCssQuerystring in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php \Drupal\common_test\Controller\CommonTestController::jsAndCssQuerystring()

Adds a JavaScript file and a CSS file with a query string appended.

Return value

string An empty string.

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

File

core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php, line 68
Contains \Drupal\common_test\Controller\CommonTestController.

Class

CommonTestController
Controller routines for common_test routes.

Namespace

Drupal\common_test\Controller

Code

public function jsAndCssQuerystring() {
  $attached = array(
    '#attached' => array(
      'library' => array(
        'node/drupal.node',
      ),
      'css' => array(
        drupal_get_path('module', 'node') . '/css/node.admin.css' => array(),
        // A relative URI may have a query string.
        '/' . drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&arg2=value2' => array(),
      ),
    ),
  );
  return \Drupal::service('renderer')
    ->renderRoot($attached);
}