Skip to content

Add support to pretty-print JSON-output#1605

Closed
neufeind wants to merge 2 commits intoFluidTYPO3:developmentfrom
neufeind:patch-3
Closed

Add support to pretty-print JSON-output#1605
neufeind wants to merge 2 commits intoFluidTYPO3:developmentfrom
neufeind:patch-3

Conversation

@neufeind
Copy link
Copy Markdown
Contributor

Optionally add JSON_PRETTY_PRINT to json_encode-options.

Resolves: #1571

Optionally add JSON_PRETTY_PRINT to json_encode-options.

Resolves: FluidTYPO3#1571
* @throws Exception
*/
protected static function encodeValue($value, $useTraversableKeys, $preventRecursion, $recursionMarker, $dateTimeFormat)
protected static function encodeValue($value, $useTraversableKeys, $preventRecursion, $recursionMarker, $dateTimeFormat, $prettyPrint)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's pass an int $options here and build the JSON_ option mask in the render method using whichever arguments apply. I can very easily see a future option needing support, which would mean another new argument for this function.

@neufeind neufeind closed this Oct 18, 2019
@neufeind neufeind deleted the patch-3 branch October 18, 2019 10:16
@neufeind
Copy link
Copy Markdown
Contributor Author

sorry for creating a new pull-request. I couldn't get github to update my old branch :-(
#1606

@NamelessCoder
Copy link
Copy Markdown
Member

No problem Stefan :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add Option "json_pretty_print" to format json Encode ViewHelpder

2 participants