Closed GoogleCodeExporter closed 8 years ago
I don't know what problem you are trying to solve.
What I think is:
1.- If you're tring to get a key called "images", which holds a list of two
associative arrays defined in one line each one, you should write in YAML:
images:
- {image: image1.jpg, type: picture}
- {image: image2.jpg, type: picture}
i.e. you should indent the list items, so that they belong to the key above
them.
With that YAML, after parsing with spyc, you get this:
array(1) {
["images"]=>
array(2) {
[0]=>
array(2) {
["image"]=>
string(10) "image1.jpg"
["type"]=>
string(7) "picture"
}
[1]=>
array(2) {
["image"]=>
string(10) "image2.jpg"
["type"]=>
string(7) "picture"
}
}
}
2.- With what you have just published, you get a list with three items, one
with key "images", and two other with correlative keys "0" and "1".
array(3) {
["images"]=>
string(0) ""
[0]=>
array(2) {
["image"]=>
string(10) "image1.jpg"
["type"]=>
string(7) "picture"
}
[1]=>
array(2) {
["image"]=>
string(10) "image2.jpg"
["type"]=>
string(7) "picture"
}
}
Original comment by nozim...@gmail.com
on 16 Jan 2013 at 9:34
Original comment by vlad.and...@gmail.com
on 9 Sep 2013 at 4:02
Original issue reported on code.google.com by
yennan.m...@gmail.com
on 26 Oct 2012 at 12:10