public function Twig_Node_Expression_Array::getKeyValuePairs in Translation template extractor 6.3
Same name and namespace in other branches
- 7.3 vendor/Twig/Node/Expression/Array.php \Twig_Node_Expression_Array::getKeyValuePairs()
3 calls to Twig_Node_Expression_Array::getKeyValuePairs()
- Twig_Node_Expression_Array::compile in vendor/
Twig/ Node/ Expression/ Array.php - Compiles the node to PHP.
- Twig_Node_Expression_Array::hasElement in vendor/
Twig/ Node/ Expression/ Array.php - Twig_Node_Expression_Array::__construct in vendor/
Twig/ Node/ Expression/ Array.php - Constructor.
File
- vendor/
Twig/ Node/ Expression/ Array.php, line 27
Class
Code
public function getKeyValuePairs() {
$pairs = array();
foreach (array_chunk($this->nodes, 2) as $pair) {
$pairs[] = array(
'key' => $pair[0],
'value' => $pair[1],
);
}
return $pairs;
}