You are here

public function TestController::testComplexPage in Tome 8

Outputs a more complex test page.

1 string reference to 'TestController::testComplexPage'
tome_test.routing.yml in modules/tome_static/tests/modules/tome_test/tome_test.routing.yml
modules/tome_static/tests/modules/tome_test/tome_test.routing.yml

File

modules/tome_static/tests/modules/tome_test/src/Controller/TestController.php, line 28

Class

TestController
Contains test pages for the tome module.

Namespace

Drupal\tome_test\Controller

Code

public function testComplexPage(Request $request) {
  $module_path = drupal_get_path('module', 'tome_test');
  return [
    '#children' => "<p>Hello, complex world</p>\n<img src=\"/{$module_path}/assets/druplicon-1.png\">\n<img src=\"/{$module_path}/assets/file%20with%20space.png\">\n<img srcset=\"/{$module_path}/assets/srcset-test1.png 320w, /{$module_path}/assets/srcset-test2.png 420w\">\n<source srcset=\"/{$module_path}/assets/srcset-test3.png\">\n<video poster=\"/{$module_path}/assets/poster-test.png\">\n<a href='/random/path'></a>\n<a href='http://www.google.com/external/path'></a>\n<a href='" . $request
      ->getSchemeAndHttpHost() . "/absolute/path'></a>\n<a href='/path/with/destination?destination=foo&bar=baz'></a>\n<iframe src='/random/iframe'></iframe>\n<img src=\"data:image/jpeg;base64,x\" />\n<meta name=\"twitter:image\" content=\"/twitter_image.png\" />\n<meta property=\"og:image\" content=\"/og_image.png\" />\n<svg><use xlink:href='/use.svg'></use></svg>",
    '#attached' => [
      'library' => [
        'tome_test/complex_page',
      ],
    ],
  ];
}