class AllowToolbarPath in Drupal 10
Same name and namespace in other branches
- 8 core/modules/toolbar/src/PageCache/AllowToolbarPath.php \Drupal\toolbar\PageCache\AllowToolbarPath
- 9 core/modules/toolbar/src/PageCache/AllowToolbarPath.php \Drupal\toolbar\PageCache\AllowToolbarPath
Cache policy for the toolbar page cache service.
This policy allows caching of requests directed to /toolbar/subtrees/{hash} even for authenticated users.
Hierarchy
- class \Drupal\toolbar\PageCache\AllowToolbarPath implements RequestPolicyInterface
Expanded class hierarchy of AllowToolbarPath
1 file declares its use of AllowToolbarPath
- AllowToolbarPathTest.php in core/
modules/ toolbar/ tests/ src/ Unit/ PageCache/ AllowToolbarPathTest.php
1 string reference to 'AllowToolbarPath'
- toolbar.services.yml in core/
modules/ toolbar/ toolbar.services.yml - core/modules/toolbar/toolbar.services.yml
1 service uses AllowToolbarPath
File
- core/
modules/ toolbar/ src/ PageCache/ AllowToolbarPath.php, line 14
Namespace
Drupal\toolbar\PageCacheView source
class AllowToolbarPath implements RequestPolicyInterface {
/**
* {@inheritdoc}
*/
public function check(Request $request) {
// Note that this regular expression matches the end of pathinfo in order to
// support multilingual sites using path prefixes.
if (preg_match('#/toolbar/subtrees/[^/]+(/[^/]+)?$#', $request
->getPathInfo())) {
return static::ALLOW;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AllowToolbarPath:: |
public | function |
Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface:: |
|
RequestPolicyInterface:: |
constant | Allow delivery of cached pages. | ||
RequestPolicyInterface:: |
constant | Deny delivery of cached pages. |