RouterTestThemeHooks.php
Namespace
Drupal\router_test\HookFile
-
core/
modules/ system/ tests/ modules/ router_test_directory/ src/ Hook/ RouterTestThemeHooks.php
View source
<?php
declare (strict_types=1);
namespace Drupal\router_test\Hook;
use Drupal\Core\Url;
use Drupal\Core\Hook\Attribute\Hook;
/**
* Hook implementations for router_test.
*/
class RouterTestThemeHooks {
/**
* Implements hook_preprocess_HOOK().
*
* Performs an operation that calls the RouteProvider's collection method
* during an exception page view. (which is rendered during a subrequest.)
*
* @see \Drupal\FunctionalTests\Routing\RouteCachingQueryAlteredTest
*/
public function preprocessPage(&$variables) : void {
$request = \Drupal::request();
if ($request->getPathInfo() === '/router-test/rejects-query-strings') {
// Create a URL from the request, e.g. for a breadcrumb or other contextual
// information.
Url::createFromRequest($request);
}
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
RouterTestThemeHooks | Hook implementations for router_test. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.