IHaveRuntimeContexts.php
Same filename in this branch
Same filename in other branches
- 10 core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php
- 10 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/IHaveRuntimeContexts.php
- 11.x core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php
- 11.x core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/IHaveRuntimeContexts.php
Namespace
Drupal\layout_builder_test\ContextProviderFile
-
core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ src/ ContextProvider/ IHaveRuntimeContexts.php
View source
<?php
namespace Drupal\layout_builder_test\ContextProvider;
use Drupal\Core\Plugin\Context\Context;
use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\Core\Plugin\Context\ContextProviderInterface;
/**
* Defines a class for a fake context provider.
*/
class IHaveRuntimeContexts implements ContextProviderInterface {
/**
* {@inheritdoc}
*/
public function getRuntimeContexts(array $unqualified_context_ids) {
return [
'runtime_contexts' => new Context(new ContextDefinition('string', 'Do you have runtime contexts?'), 'for sure you can'),
];
}
/**
* {@inheritdoc}
*/
public function getAvailableContexts() {
return [
'runtime_contexts' => new Context(new ContextDefinition('string', 'Do you have runtime contexts?')),
];
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
IHaveRuntimeContexts | Defines a class for a fake context provider. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.