function ContextInterface::createFromContext
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Plugin/Context/ContextInterface.php \Drupal\Core\Plugin\Context\ContextInterface::createFromContext()
- 10 core/lib/Drupal/Core/Plugin/Context/ContextInterface.php \Drupal\Core\Plugin\Context\ContextInterface::createFromContext()
- 11.x core/lib/Drupal/Core/Plugin/Context/ContextInterface.php \Drupal\Core\Plugin\Context\ContextInterface::createFromContext()
Creates a new context with a different value.
Parameters
\Drupal\Core\Plugin\Context\ContextInterface $old_context: The context object used to create a new object. Cacheability metadata will be copied over.
mixed $value: The value of the new context object.
Return value
static
1 method overrides ContextInterface::createFromContext()
- Context::createFromContext in core/
lib/ Drupal/ Core/ Plugin/ Context/ Context.php - Creates a new context with a different value.
File
-
core/
lib/ Drupal/ Core/ Plugin/ Context/ ContextInterface.php, line 59
Class
- ContextInterface
- Context data and definitions for plugins supporting caching and return docs.
Namespace
Drupal\Core\Plugin\ContextCode
public static function createFromContext(ContextInterface $old_context, $value);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.