Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to pretty-print JSON-output #1605

Closed
wants to merge 2 commits into from

Conversation

neufeind
Copy link
Contributor

Optionally add JSON_PRETTY_PRINT to json_encode-options.

Resolves: #1571

Optionally add JSON_PRETTY_PRINT to json_encode-options.

Resolves: FluidTYPO3#1571
* @return string
* @throws Exception
*/
protected static function encodeValue($value, $useTraversableKeys, $preventRecursion, $recursionMarker, $dateTimeFormat)
protected static function encodeValue($value, $useTraversableKeys, $preventRecursion, $recursionMarker, $dateTimeFormat, $prettyPrint)
Copy link
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
Contributor Author

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

@NamelessCoder
Copy link
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