public function dataViewAction(Request $request, $blockId) { $block = $this->getBlockService()->getBlock($blockId); unset($block['meta']['default']); foreach ($block['meta']['items'] as $key => &$item) { $item['default'] = $block['data'][$key]; } return new Response('<pre>' . StringToolkit::jsonPettry(json_encode($block['meta'], JSON_UNESCAPED_UNICODE)) . '</pre>'); }
public function testJsonPettryWithString() { $string = "hello,I'm stefaine."; $jstring = json_encode($string); $result = StringToolkit::jsonPettry($jstring); $this->assertEquals($jstring, $result); }