public function Twig_Node_Expression_Array::getKeyValuePairs in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/lib/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/ twig/ lib/ Twig/ Node/ Expression/ Array.php - Compiles the node to PHP.
- Twig_Node_Expression_Array::hasElement in vendor/
twig/ twig/ lib/ Twig/ Node/ Expression/ Array.php - Twig_Node_Expression_Array::__construct in vendor/
twig/ twig/ lib/ Twig/ Node/ Expression/ Array.php - Constructor.
File
- vendor/
twig/ twig/ lib/ 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;
}