Пример #1
0
 protected function convertToViewArguments(\Twig_Node_Expression_Array $array)
 {
     $arguments = array();
     foreach (array_chunk($array->getIterator()->getArrayCopy(), 2) as $pair) {
         if (count($pair) == 2) {
             $key = $pair[0]->getAttribute('value');
             $value = $pair[1]->getAttribute('value');
             // @todo support for multiple types
             $arguments[$key] = $value;
         }
     }
     return $arguments;
 }