Development

#6742 (Broken Json)

You must first sign up to be able to contribute.

Ticket #6742 (closed documentation: fixed)

Opened 7 months ago

Last modified 7 months ago

Broken Json

Reported by: Russ Assigned to: Russ
Priority: minor Milestone:
Component: other Version: 1.2.7
Keywords: Cc:
Qualification: Unreviewed

Description

(reported by bjori via irc)

In http://www.symfony-project.org/book/1_2/18-Performance#chapter_18_sub_skipping_the_template

[["title","My basic letter"],["name","Mr Brown"]]

should be:

[{"title":"My basic letter"},{"name":"Mr Brown"}]

Change History

07/03/09 17:03:19 changed by FabianLange

it is in chapter 11 as well

07/03/09 17:11:22 changed by Russ

Description should be <"title", "My basic letter"], ["name", "Mr Brown">

if anyone happens to be searching...

07/06/09 00:45:32 changed by Russ

After some testing, to get the output of the array in the hint on chapter 11, you actually simply need:

{"title:My basic letter", "name:Mr Brown"}

This is probably the format most people will end up with, since it's the one you get when you pass a single dimensioned array to json_encode().

[{"title":"My basic letter"},{"name":"Mr Brown"}] would be the result of:

array(array("title" => "My basic letter"), array("name" => "Mr Brown"))

Which may be desired but is overcomplicated for the docs.

07/06/09 00:45:41 changed by Russ

  • owner changed from fabien to Russ.
  • status changed from new to assigned.

07/06/09 01:09:57 changed by Russ

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [19905]) [doc][1.0,1.1,1.2] Fixes #6742 - Fix syntax in json example Chose not to simplify/modify as to do so would be inconsistent with examples in chapter 11

07/06/09 01:38:16 changed by Russ

(In [19906]) [doc][1.1,1.2,1.3] Fixes #4420, refs #6742 - Simplified json examples with better use-case

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.