function Debug::getContextVariables
Same name in other branches
- 4.x src/Twig/Extension/Debug.php \Drupal\devel\Twig\Extension\Debug::getContextVariables()
Filters the Twig context variable.
Parameters
array $context: The Twig context.
Return value
array An array Twig context variables.
2 calls to Debug::getContextVariables()
- Debug::doDump in src/
Twig/ Extension/ Debug.php - Writes the debug information for Twig templates.
- Debug::message in src/
Twig/ Extension/ Debug.php - Provides debug function to Twig templates.
File
-
src/
Twig/ Extension/ Debug.php, line 230
Class
- Debug
- Provides the Devel debugging function within Twig templates.
Namespace
Drupal\devel\Twig\ExtensionCode
protected function getContextVariables(array $context) : array {
$context_variables = [];
foreach ($context as $key => $value) {
if (!$value instanceof Template) {
$context_variables[$key] = $value;
}
}
return $context_variables;
}